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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Jaime123
Regular Visitor

Ranked Customers by Month

Hi Everyone,

I need some assistance with getting ranks by month. Here is an example of my data:

Data.png

I am trying to get a new column with the rank for each customer based on sales per month. So I can rank customers from 1 to 5 for each month.

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@Jaime123,

Create the following column in your table and check if you get expected result.

RankColumn = RANKX(FILTER(Table,Table[Month]=EARLIER(Table[Month])),Table[Sales],,DESC,Dense)

1.JPG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yuezhe-msft
Employee
Employee

@Jaime123,

Create the following column in your table and check if you get expected result.

RankColumn = RANKX(FILTER(Table,Table[Month]=EARLIER(Table[Month])),Table[Sales],,DESC,Dense)

1.JPG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for your help Lydia! 

Ashish_Mathur
Super User
Super User

Hi,

 

Try this calculated field formula

 

=RANKX(ALL(Data[Customer Name]),[Revenue])

 

I have assumed that Revenue is a field you have computed as the sum of the sales column in your Data Table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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