cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Pablos_007
Regular Visitor

RANKX Trying to Rank Turnover By Customer By Week -Calculated Column Help needed please..

My goal is to Rank Total Turnover By Customer By Week.

 

I have this as a calculated column:-

=RANKX(ALL(ASC_TBI_TBL[Customer]),CALCULATE([Total Turnover 2023],ALLEXCEPT(ASC_TBI_TBL,ASC_TBI_TBL[Customer])),,DESC)

 

My calculated column doesn't work quite as expected. If you select single week number (say week number 1) it doesnt give ranking results 1,2,3 etc.

It does work ok if all weeks are selected. Somehow I need to add a filter on week to see result for individual week.

 

In Table,  ASC_TBI_TBL,  I do have column named Week. Week contains numbers 1 to 52.

 

How can I add FILTER to my calculated column to give the desired output?

 

Thanks in advance,

 

Pablos

 

Pablos

 

 

1 ACCEPTED SOLUTION
Pablos_007
Regular Visitor

Solution Found. 

First, I needed to create a 'unique' column I could rank on.

I created a column named Customer_Product that was the Customer and Product columns joined together. 

Next, created a measure named Rank Turnover By Customer By Product.

DAX 

=IF(HASONEVALUE(ASC_TBI_TBL[Week Number]),RANKX(ALL(ASC_TBI_TBL[Customer_Product]),[Total Turnover 2023],,DESC,Dense),BLANK())

 

Hope this helps others 🙂

View solution in original post

3 REPLIES 3
Pablos_007
Regular Visitor

Solution Found. 

First, I needed to create a 'unique' column I could rank on.

I created a column named Customer_Product that was the Customer and Product columns joined together. 

Next, created a measure named Rank Turnover By Customer By Product.

DAX 

=IF(HASONEVALUE(ASC_TBI_TBL[Week Number]),RANKX(ALL(ASC_TBI_TBL[Customer_Product]),[Total Turnover 2023],,DESC,Dense),BLANK())

 

Hope this helps others 🙂

Padycosmos
Solution Sage
Solution Sage

Padycosmos - thank you for reading my post and taking the time to reply. I will check out the videos.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors