Forum Discussion

nphadro's avatar
nphadro
Advocate IV
8 years ago
Solved

DAX Formula Explanation

I saw a video that showed the formula below:   margin group 2 = CALCULATE([sales], FILTER(VALUES(Table1[Profit]), COUNTROWS( FILTER(Table2, Table1[Profit]>=Table2[Min] && Table1[Profit]<=Tabl...
  • marcussyliu's avatar
    marcussyliu
    8 years ago

    Hi,

     

    This is a typical pattern used for dynamic segragation calculation. Note that Table1 and Table2 have no relationship, and you can see Table1 as a fact table and Table2 a parameter table. So the only usage of the measure that makes sense is in a query for sales by group. For example, if you create a matrix visual and drag Group column from Table2 to Row section and the measure to Value section, you will then see how the measure works to return the correct result for each group.

     

    Hope this helps.