Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

DAX not working.

Hi.

I have created 2 measures using same formula, but one of my DAX is not working and other is working fine.

I have attached screenshots of the same.

 

 

Highest Qualifications and Attendance are calculated using same formula;
Highest Qualifications = MAX(WC_Years[QualifiedTeams])
Highest Attendance = MAX(WC_Years[Attendance])
 
I don't know why it is giving an error.
 
 
  • Fowmy's avatar
    Fowmy
    5 years ago

    Anonymous 

    So you need the year with the highest value:

    Qualification = 
    
    MAXX(
        TOPN (
            1,
            ALLSELECTED (WC_YEARS[YEAR]),
            [Highest Qualification]
        ),
        WC_YEARS[YEAR]
    )

7 Replies

  • Anonymous 

    The 2nd screenshot doesn't show the Qualification measure, you need to clear on it and share the screenshot.

    You use ALLSELECTED(WC_Years[Year]) instead of GROUP BY

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Fowmy 

      ALLSELECTED() too is giving the same error.

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        You are getting this error because the TOPN function is returning multiple values. There are multiple years for which the value is equal to Highest Qualifications.