Watch Those DAX Calculations

Kevin Feasel

2015-12-18

DAX

Chris Webb shows us a case in which Power BI Desktop’s DAX calculation might not be what you expect:

The difference here is that the Month Number and Month Name fields are both present – they have to be since the query has to sort by Month Number. In MDX the order of members on a hierarchy can be set inside the model; in a DAX query you can only sort using an ORDER BY clause and for that to work, the field you’re ordering by must be present in the query.

This kind of feels like an edge case, but if you run into it, it’s good to know that it’s not a bug.

Related Posts

SUMX() in Power BI

Rob Collie explains the power of SUMX() in DAX: Have you ever written an array formula in Excel?  (Don’t worry, most people haven’t).  Have you ever written a FOR loop in a programming language?  (Again, don’t worry, there’s another question coming).  Have you every repeated something over and over again, slowly building up to a […]

Read More

Debugging DAX Variables

Imke Feldmann has a lengthy Power Query script to help debug issues with DAX variables: When you’re dealing with a beast like DAX you can use any help there is, right? So here I show you how you can debug DAX variables who contain tables or show the result of multiple variables at once. So […]

Read More

Categories

December 2015
MTWTFSS
« Nov Jan »
 123456
78910111213
14151617181920
21222324252627
28293031