Tag Archive: DAX

  • There Is More Than One Way to Query Your Data: Have You Tried DAX?

    Power BI is fantastic for building reports, but sometimes you just need to get data out of a semantic model quickly, without building a full report page to do it. However, what if you need to dig further into a specific snapshot of your data? For example: What if you wanted to pull a precise slice of data into Excel for a one-off analysis? Or maybe you’re building a bespoke report and want to make sure it’s using the same agreed…

    » Read more
  • How Power BI Totals are Calculated

    Tom wearing a black and purple Purple Frog Systems polo shirt, standing in front of a graphic background featuring hexagonal patterns and an image of hands using a calculator and laptop. Text on the image reads: “How Power BI Totals are Calculated.”

    When using Power BI visuals such as a table or matrix, they use a built in total column for your rows or columns. When using it, you may have noticed that the totals column sometimes doesn’t add up to a Grand Total as might be expected. It sometimes looks like the below screenshot:     From first glance, you can see that the “Total” column isn’t the sum of its row, as you might expect. So why is this the case? The “Total”…

    » Read more
  • Fill Blank Rows With Previous Non-Blank Values – DAX

    Fill Blank Rows With Previous Non-Blank Values - DAX

    Fill Blank Rows With Previous Non-Blank Values – DAX I want to see a value for everyday, whether a new value exists or not – lets call it tracking the members of a golf club. If there are no changes to the member numbers, I would have no movement figure on that day. If someone joined or left, the figure would be updated. Just because there are no changes, it doesn’t mean that there are no members on that date and therefore this day is…

    » Read more
  • BLANK() Function Not Working As Expected

    Trying to handle blank values in Power BI… I needed a measure that would fill blank gaps across days where a value wasn’t present – I thought the BLANK() function would help me achieve this. My goal for the results of the measure is shown below: The logic is quite simple, if the value on that day is not blank, take that value. If it is blank then take the previous non-blank value. The first piece of logic is to get the date where…

    » Read more
  • Replacing Nested IFs with SWITCH() functions in DAX

    When solving problems and requirements for reports in Power BI, there eventually comes a need for nested IF() statements in your DAX. They work just fine, until they don’t. The more conditions you add, the harder they become to read, maintain and debug. There’s a cleaner way to handle this kind of logic and it’s one that often gets overlooked: SWITCH(). Let’s take a look at why it’s worth getting familiar with and how it can make your…

    » Read more
  • Field Parameters in Power BI

    Field Parameters in Power BI

      Field parameters are another tool for Power BI developers to make their reports more dynamic and interactive. They are currently a preview feature as of writing this blogpost, meaning you will need to enable it in the preview settings and I will show you how to do this further on in the blog.   What Are Field Parameters? Field parameters enable report readers to switch between different fields or measures in a visual with just a…

    » Read more
  • Learning through ‘Unconventional’ Power BI Projects

    Learning through ‘Unconventional’ Power BI Projects

    When we think of Power BI projects we typically think of solving business problems through creating insightful analytical reports and dashboards, Power BI is fantastic for this. However, when trying to expand your knowledge on the functionality of Power BI, I have found it incredibly useful to think outside of the scope of these types of project and explore other ways to use it. In this blog I will show an example of an unconventional Power BI…

    » Read more
  • Automating DAX Measure Formatting in Power BI with Tabular Editor

    Until coming across this piece of code, I often used the DAX formatter (https://www.daxformatter.com/) to format all of my Tabular Model measures. However, if you end up writing a lot of measures in your Tabular Model this can become quite tedious. There is a faster method however. Using Tabular Editor 2 and some basic C# code you can format all of your Tabular model measures at once. Assuming you have Tabular Editor 2 installed on your machine,…

    » Read more
  • Power BI Table Totals Not Adding Up? Here’s Why!

    Power BI Table Totals Not Adding Up? Here's Why!

    Ever built a table containing measures in Power BI, done a quick sanity check on your table totals and noticed they’re incorrect? Let’s explore why this may be. Here we have a simple table, built from data in the AdventureWorks database. It shows the three product categories, the Total Sales and Average Order Total of each category: As you can see, the Total Sales column adds up perfectly, but the average is just plain wrong. 19.42 +…

    » Read more
  • Power BI – Visual to show filters that have been applied to a report

      Most PowerBi reports will use slicers to allow the user to filter and interact with the visuals they have. But in practice, users may forget what slicers have been applied. It’s inconvenient to have to look through each slicer, potentially across multiple pages, to see what filters are being used on the report. Therefore, it is not user friendly. We need to show every filter that has been applied in one convenient place. Thankfully,…

    » Read more