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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Rank by one attribute when there is more than one attribute in a table

Hi Everyone,

 

I have a table visual with Manager in column 1, Region in column 2, and store in column 3.  Manager is from database #1 while Region & store are from database #2 (these tables are joined).  

 

I am trying to rank P% by Manager for what is selected in the slicers.  If I use RANKX(allselected(Manager[Mgr]), [P%]), it works fine if ONLY Manager (column 1) is in the table visual.  However, when region and store are added (columns 2 & 3) to the visual, it gives me what appears to be non-sensical ranking numbers. 

 

How do I rank based on Manager while also having region and store in the visual?

 

Thanks,

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

 

Thanks to everyone who took the time to either post or email me with suggestions - it is much appreciated!  The correct solution came from Oxenskiold:

 

RANKX(all(db#1[Mgr]),CALCULATE([PVR%],all(db#2[Region])),,,Dense)

 

...then it was just a matter of re-arranging the matrix to get the correct presentation of the ranking based on what fields I wanted to include.

 

Thanks.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi,

 

Thanks to everyone who took the time to either post or email me with suggestions - it is much appreciated!  The correct solution came from Oxenskiold:

 

RANKX(all(db#1[Mgr]),CALCULATE([PVR%],all(db#2[Region])),,,Dense)

 

...then it was just a matter of re-arranging the matrix to get the correct presentation of the ranking based on what fields I wanted to include.

 

Thanks.

Hi @Anonymous,

Congratulation to you have resolved your issue, please mark the correspoding reply as answer. So others can find solution clearly.

 

Best Regards,
Angelia

Based on my understanding of your design, allselected is not the right formula. Try using all instead. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

And maybe not just ALL(Manager[Mgr]) but maybe ALL(Manager) instead, since you've put everything on the same table.

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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