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
Anonymous
Not applicable

Rank, select by filter

Hi all,

I created two option: "By Revenue" and "By Unites".
Now I want when user will click on "By Revenue" my table show all information in Desc by Revenue,
When filter will changed to "By Unites" my table show all information in Desc by Unites.

ifTrue = SELECTEDVALUE('order'[Order])
Rank = RANKX(ALL(POS),POS[UnitsSold])
Rank$ = RANKX(ALL(POS),POS[Revenue])
 
And please tell me if I need some relationships between querys?



pic1.PNG

1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

 

By my test, there is a measure you can have a try. And you have to sort by the measure.

 

1.By Revenue = SUM(Table1[Revenue])

2.By Unites Sold = SUM(Table1[Units Sold])

3.Measure =

VAR se = SELECTEDVALUE ( 'order'[Order] )

RETURN

IF (ISBLANK ( se ), BLANK (),

IF ( se = "By Revenue",

RANKX ( ALL ( Table1 ), [By Revenue],, DESC, DENSE ),

RANKX ( ALL ( Table1 ), [By Unites Sold],, DESC, DENSE )

)

)

 

Choose the visual --> sort by the measure you created.

tempsnip3.png

Then you get the visual you want.

rank1.pngtempsnip2.png

 

 

 

Best Regards,

Xue Ding

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

 

By my test, there is a measure you can have a try. And you have to sort by the measure.

 

1.By Revenue = SUM(Table1[Revenue])

2.By Unites Sold = SUM(Table1[Units Sold])

3.Measure =

VAR se = SELECTEDVALUE ( 'order'[Order] )

RETURN

IF (ISBLANK ( se ), BLANK (),

IF ( se = "By Revenue",

RANKX ( ALL ( Table1 ), [By Revenue],, DESC, DENSE ),

RANKX ( ALL ( Table1 ), [By Unites Sold],, DESC, DENSE )

)

)

 

Choose the visual --> sort by the measure you created.

tempsnip3.png

Then you get the visual you want.

rank1.pngtempsnip2.png

 

 

 

Best Regards,

Xue Ding

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.