{"id":10279,"date":"2020-11-23T14:32:15","date_gmt":"2020-11-23T22:32:15","guid":{"rendered":"https:\/\/threecloud.wpengine.com\/post\/dax-calculate-and-filter-functions-in-power-bi\/"},"modified":"2023-07-28T11:43:47","modified_gmt":"2023-07-28T18:43:47","slug":"dax-calculate-and-filter-functions-in-power-bi","status":"publish","type":"post","link":"https:\/\/3cloudsolutions.com\/resources\/dax-calculate-and-filter-functions-in-power-bi\/","title":{"rendered":"DAX CALCULATE and FILTER Functions in Power BI"},"content":{"rendered":"<p>We all know Power BI is a powerful analytics tool and it\u2019s easy to create a new Power BI Desktop file, import some data into it and create reports that show valuable insight. Adding Data Analysis Expression, better known as DAX, enables you to get the most out of your data.<br \/>\nIf you\u2019re new to Power BI or DAX, DAX is a collection of formulas, or expressions, that are used to calculate and return one or more values. DAX helps you to use data already in your model and create new information from it that can solve real business problems.<br \/>\nWhen I first started using DAX functions, it brought my Power BI skills to the next level. I was able to tackle some analytical needs that I had struggled with in the past. I\u2019m here to share a couple favorite formulas that I use all the time called the CALCULATE function and the FILTER function. Please be sure to watch my video included in this post as I walk through using this DAX formula.<br \/>\n\u2022 In my demo, I\u2019m working with a data set to find the beginning balance for 2017 for our assets.<br \/>\n\u2022 To do that I need to sum a column in my table called beginning balance when fiscal year equals 2017 and when financial type equals asset.<br \/>\n\u2022 I\u2019ll do this by using a combination of the CALCULATE function and the FILTER function. The CALCULATE function allows you to calculate a function on the entire table.<br \/>\n\u2022 In my code I\u2019m going to CALCULATE the sum on our beginning balance. This would calculate the sum for the entire table.<br \/>\n\u2022 But we only want to calculate the sum for 2017 for just the assets and financial type. For this, once we have calculated the table, we need filter that table. Think of this FILTER function as making a digital table in the background.<br \/>\n\u2022 We need to FILTER it where fiscal year equals 2017 and where finance type equals asset. In my code, I\u2019ll add FILTER for the function, and we need to tell it what table we are going to be filtering, in my case it\u2019s the balance table. Then add where fiscal year equals 2017 and where finance type equals asset.<br \/>\n\u2022 Using these DAX functions, our result will show the beginning balance for our assets for 2017.<br \/>\n\u2022 My video shows you exactly how to write the code I used here, so be sure to check it out.<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/X6GWCLj4lec\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>As you can see, this is super simple, and this formula allows you flexibility in how you write it. You can FILTER tables in many ways and use different functions within CALULATE. I hope you enjoyed this simple use case of these powerful DAX functions in Power BI.<\/p>\n<p>Need further help? Our expert team and solution offerings can help your business with any Azure product or service, including Managed Services offerings. Contact us at 888-8AZURE or sales@3cloudsolutions.com.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We all know Power BI is a powerful analytics tool and it\u2019s easy to create&mldr;<\/p>\n","protected":false},"author":36,"featured_media":10755,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[260],"tags":[273],"class_list":["post-10279","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-ai","tag-power-bi","topics-blog"],"acf":[],"_links":{"self":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts\/10279","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/users\/36"}],"replies":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/comments?post=10279"}],"version-history":[{"count":0,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts\/10279\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/media\/10755"}],"wp:attachment":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/media?parent=10279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/categories?post=10279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/tags?post=10279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}