Forum Discussion

Burningsuit's avatar
Burningsuit
Icon for Resident Rockstar rankResident Rockstar
9 years ago
Solved

DAX "ALL" function not working on sorted columns

  I have a problem with a DAX expression.  It’s when I want to use the ALL function on the Month column of my Date Table to show Total Sales across all months in each year.  If you look at the table...
  • Anonymous's avatar
    Anonymous
    9 years ago

    Burningsuit,

    What you describe is by design. When Month column is sorted by MonthNo column, adding Month column to a report also add MonthNo column to the report. Thus, the measure must apply ALL to both Month column and MonthNo column, in other words, you should create the measure using the DAX as below.

    AllMonths2= CALCULATE([TotalSales],ALL(DateTable[Month]), ALL(DateTable[MonthNo]))

    There is a issue for your reference:
    https://community.powerbi.com/t5/Issues/Bug-with-Power-BI-Desktop-ALL-function/idi-p/181454

    Regards,