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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.