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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Rank based on Month to Date Sales but show Cumulative Sales by Day

Hi,

 

I'm sure this has been covered but I did not find a solution. 

 

I need to Rank Divisions by Cumulative Month to Date Sales

The Charts will show Cumulative Sales by Day for the top Divisions

The Chart will filter by Division MTD Sales Rank so the first chart on the page is Ranked Division #1 etc.

 

I have the Cumulative Sales Measure but the RANKX function is ranking by Day, not MTD. That means the chart intended for one Division will show mulktiple based on daily sales rank. 

 

Again, the Chart is to be filtered by the Division Rank for Month to Date Sales (show only one Division per chart).

 

Here is my DAX (The Sales value is a Measure of the Sum of Sales):

 

Division Rank = RANKX (
ALLSELECTED ( Division[DivisionIDName]),
CALCULATE ( ( _Sales[Revenue_LocalCurrency] ) ))

3 REPLIES 3
v-danhe-msft
Employee
Employee

Hi @Anonymous,

Could you please post me some sample data and your desired result or share the pbix file if possible?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

The data is very simple: this is made up but it is basically the data

DateDivisionSalesDivision Rank based on MTD Sales
1/1/2018110001
2/1/2018112001
3/1/201818001
4/1/201819001
1/1/201839003
2/1/2018311003
3/1/201837003
4/1/201838003
1/1/201879502
2/1/2018711502
3/1/201877502
4/1/20187850

2

 

The Issue is that We want the Division ranked based on the MTD Sales but want to show the Month to Date Sales daily in a chart.  This is a real example clip. Chart 1 shows the #1 ranked Division. It is the largest division so every day it it the #1 rank.  Chart 2 shows what happens when I make a chart of the #2 ranked Division. The #2 rank changes by day so the chart shows multiple Divisions. I want it to show only the #2 ranked Division as of today for each day. The Chart should show only Division 3 for each day as it is currently the #2 ranked Division.

example of ranked chart.png

Anonymous
Not applicable

@Anonymous

 

I saw your post regarding RANKX. Maybe you know how to do this. (see original post). 

 

The  RANKX needs to be told to rank based on Month to Date Sales so it does not rank by the time placed into the chart which is daily. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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