Forum Discussion

AlanP514's avatar
AlanP514
Post Patron
4 years ago
Solved

Dax Error

Hai All I need help on this  Requirement: Want to create a pie chart  1 by default it should show max month otherwise it should show selected month v/s category column(column consist of different c...
  • tamerj1's avatar
    4 years ago

    AlanP514 

    Please try

     

    CM =
    VAR MaxMonth =
        CALCULATE ( MAX ( Initiative[Year Month] ), REMOVEFILTERS ( 'Calendar' ) )
    VAR SelectedMonth =
        SELECTEDVALUE ( 'Calendar'[Year Month] )
    VAR FinalMonth =
        IF ( [Is Year Filtered] = TRUE (), MaxMonth, SelectedMonth )
    RETURN
        CALCULATE ( [# Model Number], 'Calendar'[Year Month] = FinalMonth )