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
johnmelbourne
Helper V
Helper V

RANKX amatuer

Hi

 

I have a datset like this

1.PNG

and I want to produce this with a slicer / filter ? for date 

using 30/9/2018

 

2.PNG

 

Similarly if I choose 30/12/2018 I should ge this ....

3.PNG

 

I just can't seem to work it out at the moment. I keep getting an answer of, for example 4!

So confused.

 

I don't particularly want to hard code a filter into the DAX, and would rather use a drop down slicer if possible. Any clues or assistance would be appreciated.

 

Thanks

John

 

 

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Create a Calendar Table and build a relationship from the EndDate column of your Table to the Date column of the Calendar Table.  To your visual/slicer, drag the Date column from the Calendar Table.  To your Table visual, drag the Company column.  Write these measures

Total = SUM(Data[ColumnA])

Rank = RANKX(ALL(Data[Company]),[Total])

Hope this helps.


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

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Create a Calendar Table and build a relationship from the EndDate column of your Table to the Date column of the Calendar Table.  To your visual/slicer, drag the Date column from the Calendar Table.  To your Table visual, drag the Company column.  Write these measures

Total = SUM(Data[ColumnA])

Rank = RANKX(ALL(Data[Company]),[Total])

Hope this helps.


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

Since that worked so well @Ashish_Mathur ..... would you have any hints about a solution for the above where I had one measure for rank this quarter, and then another column (measure) for rank last quarter? So I can show the movement of rank between quarters?

 

Any assistance would be greatly appreciated.

 

 




@Ashish_Mathur wrote:

Hi,

Create a Calendar Table and build a relationship from the EndDate column of your Table to the Date column of the Calendar Table.  To your visual/slicer, drag the Date column from the Calendar Table.  To your Table visual, drag the Company column.  Write these measures

Total = SUM(Data[ColumnA])

Rank = RANKX(ALL(Data[Company]),[Total])

Hope this helps.



 

 

Hi,

In the Calendar Table, create a Quarter column as well.  Drag the quarter column to your slicer/filter and select any quarter.  Write this measure

Rank in previous quarter = CALCULATE([Rank],PREVIOUSQUARTER(Calendar[Date]))

Hope this helps.


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

Many thanks for taking the time to respond. Your solution is perfect. So "simple", so beautiful. 

Thank you.


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

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.