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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
johnmenx
Frequent Visitor

Creating ranking of column selected in field parameter based on sales.

Hi, so here is my use case: I need create a ranking of a column based on sales, but this ranking must change based on the column selected witht he dynamic parameter. So I may have selected "Name" from Table A in the dynamic parameter, and it will create a ranking of all my names. Then I may select "Region" from Table B by changing the parameter selection and now my ranking will change to reflect the regional ranking against sales instead. I have done this with static columns for a use case but now I need to make it work dynamically.

Here is the dax i have been using till now:

RANKXFILTERALLSELECTED ('Column'), NOT ISBLANK( [Sales] )), [Sales], , DESC, Dense)

Here is the dax I need it to work as: 
RANKX( FILTER( ALLSELECTED ('Dimensions'[Column Selection] ), NOT ISBLANK( [Sales] )), [Sales], , DESC, Dense)


But this doesnt work and gives me the following error that the column is part of a composite key.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @johnmenx,

I'd like to suggest you take a look at the calculation groups, it allow you to create dynamic expression based current measures.

Creating Calculation Groups in Power BI Desktop - SQLBI

Regards,

Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

HI @johnmenx,

I'd like to suggest you take a look at the calculation groups, it allow you to create dynamic expression based current measures.

Creating Calculation Groups in Power BI Desktop - SQLBI

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors