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
laciodrom_80
Helper IV
Helper IV

Dax: need help

Hi guys,

 

I've got a table (Table1) where Scenario and Value are two columns (string and number respectively) and Ranking is a measure:

 

 

Ranking = RANKX(ALLSELECTED(Table1[Scenario]); CALCULATE(SUM(Table1[Value])); ;ASC;Dense)

 

In my Report I create this table with Scenario column and Ranking measure


Immagine.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Then I have another measure which gives me a specified ranking (specifiedRanking😞 I would like to create a new measure which returns the corresponding Scenario starting from this specifiedRanking, how could I write a dax expression for this goal?

 

Thanks a lot for any hint

 

Luca
1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@laciodrom_80

 

Something like this may be

 

Measure =
VAR myrank = [specifiedranking]
RETURN
    MINX ( FILTER ( VALUES ( Table1[Scenario] ), [Ranking] = myrank ), [Scenario] )

Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@laciodrom_80

 

Something like this may be

 

Measure =
VAR myrank = [specifiedranking]
RETURN
    MINX ( FILTER ( VALUES ( Table1[Scenario] ), [Ranking] = myrank ), [Scenario] )

Regards
Zubair

Please try my custom visuals

@Zubair_Muhammad  

 

I noticed that if I try to not use VAR myrank, directly using specifiedranking like this:

 

 

Measure = MINX ( FILTER ( VALUES ( Table1[Scenario] ), [Ranking] = [specifiedranking]), [Scenario] )

 

 

the measure isn't right computed any more...why must I use the local variable myrank?

 

thnaks

 

Luca

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.