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

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

Reply
PowerBITestingG
Resolver I
Resolver I

Exclude field from Rankx

I have the following formula:

 

RANKX(ALLSELECTED(ProductList[ProductCode),[Total Quantity],,DESC,Dense)
 
The measure works well, but the issue is that when I put it in a matrix with Month Columns, its ranking based on the Total Quantity for each Month. I want it to rank by the Total Quantity of all months while still keeping the rest of the filters.
 
Any ideas?
 
Edit: Basically the ranking should use the Quantity in the Total column for each month.

ProductCodeJanuaryFebruary Total
ABD12101020
1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @PowerBITestingG ,

 

You need to apply a filter modifier to the measure  your rank is based on. That would be something like

CALCULATE ( [Total Measure], ALL ( Dates[month column] ) )

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
danextian
Super User
Super User

Hi @PowerBITestingG ,

 

You need to apply a filter modifier to the measure  your rank is based on. That would be something like

CALCULATE ( [Total Measure], ALL ( Dates[month column] ) )

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Instead fo ALL I used ALLSELECTED and that seems to work. Thanks!

If you want just all the visible months in the current context, ALLSELECTED would work. For all months, use ALL instead.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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.

Top Solution Authors