Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SanketBhagwat
Solution Sage
Solution Sage

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.

 

Screenshot (127).pngScreenshot (129).png

 

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.
 
 
1 ACCEPTED SOLUTION

@SanketBhagwat 

So you need the year with the highest value:

Qualification = 

MAXX(
    TOPN (
        1,
        ALLSELECTED (WC_YEARS[YEAR]),
        [Highest Qualification]
    ),
    WC_YEARS[YEAR]
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

7 REPLIES 7
Fowmy
Super User
Super User

@SanketBhagwat 

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

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Hi @Fowmy 

ALLSELECTED() too is giving the same error.

 

Screenshot (130).png

 

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. 

Hi @Fowmy @Aditya_Meshram 

I just noticed that there are multiple year values for which the 'Highest Qualifications' measure is giving the same value.

Do you guys know any DAX which will return only 1 year value.

 

 

@SanketBhagwat 

You can use MAXX

Attendnace = 
MAXX (
  VALUES(WC_YEARS[YEAR]),
  [Highest Attendance]
)

 Qualification = 
MAXX (
  VALUES(WC_YEARS[YEAR]),
  [Highest Qualification]
)

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Sorry, but the solution you provided didn't gave the correct answer.
Screenshot (131).png

 

@SanketBhagwat 

So you need the year with the highest value:

Qualification = 

MAXX(
    TOPN (
        1,
        ALLSELECTED (WC_YEARS[YEAR]),
        [Highest Qualification]
    ),
    WC_YEARS[YEAR]
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors