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

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

Reply
roshenrrujj
Frequent Visitor

Filtering the Report defaults RANKX and it just show just 1

Hi all, is there a way to make RANKX to show the right rank in overall data even after filters applied? 

 

this is my data sample. 

 

JobContractorContractor PaymentStateRegionTownWork StartedWork Ended
84397501086$10,329.26QLDQLD RuralRockhampton14/03/2023 
84412391126$82,135.70QLDQLD RuralRockhampton1/03/2023 
99095071148$4,020.85NSWNSW RuralTweed Heads3/05/2023 
84387201198$4,042.37QLDQLD RuralRockhampton3/02/202330/03/2023
84387201198$10,501.92QLDQLD RuralRockhampton3/02/202330/03/2023
84397501198$24,447.44QLDQLD RuralRockhampton12/04/2023 
84502451198$199,771.46NSWNSW RuralTweed Heads6/04/2023 
84504321305$43,029.86TASTASHobart24/05/2023 
84445721484$253,608.70QLDQLD RuralRockhampton16/02/2023 
99060181649$8,329.19VICVIC MetroMelbourne8/03/202323/05/2023
84542131655$75,492.70VICVIC RuralAlbury/Wodonga1/05/2023 
601013491743$913.68VICVIC MetroMelbourne12/01/202312/01/2023
84521161824$15,431.13SASAAdelaide12/05/2023 
84522631824$23,402.84WAWAPerth5/05/2023 
84429471832$169,773.98VICVIC MetroMelbourne25/01/2023 
84537001832$118,862.25VICVIC RuralBendigo27/02/2023 
84454121869$79,651.77QLDQLD RuralRockhampton6/04/2023 
99086981918$2,904.14QLDQLD MetroBrisbane28/02/2023 
99086981918$1,920.60QLDQLD MetroBrisbane28/02/2023 

 

 

my RANKX:

RANK = RANKX(ALLSELECTED(DATA[Contractor]), [Avg Payment])
 
result:
roshenrrujj_0-1689666412450.png

 

but when i filter the table, lets say to contractor=1824, instead of 8, i get 1

roshenrrujj_1-1689666468447.png


can someone please help me to come up with a DAX query that would produce the original RANK even after the filtering applied? 

thanks.  

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Instead of ALLSELECTED you need to use ALL

My Rank = RANKX( ALL('Table'[Contractor]), [Avg Payment] )

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

Instead of ALLSELECTED you need to use ALL

My Rank = RANKX( ALL('Table'[Contractor]), [Avg Payment] )

thank you so much! worked perfectly! 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.