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
Anonymous
Not applicable

Ranking with animated filter context

Hey everyone,

 

I have an animated dashboard. And I want to show the top 10 drivers who have been awarded with the most points (points received per season). The ranking does work when the animation isn't running. When the animation is running, I only see the rank of the drivers of that particular year compared to all previous years. But I also want to see the rank of the drivers from the previous years. I hope the image makes it clear:

 

Rank points.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The rank formula is as follows:

Rank highest points per season =
CALCULATE(RANKX(ALL(PointsByYear[DriverAndYear]),
[Highest points per season],,
DESC, Dense),
ALL(PointsByYear),VALUES(PointsByYear[DriverAndYear]) )
 
And the formula Highest points per seasons is: 
Highest points per season =
CALCULATE(SUM(PointsByYear[PointsbyYear] ),
FILTER(ALL('Date'),'Date'[Date] <= MAX('Date'[Date]))


 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I found the solution for the Rank measure. Apparantly, you also had to filter the date for the Rank measure. 

So, the first measure was this: 

Highest points per season =
CALCULATE(SUM(PointsByYear[PointsbyYear] ),
FILTER(
ALL('Date'),'Date'[Date] <= MAX('Date'[Date]))
 
And the rank measure is as following:
Rank highest points per season =
CALCULATE(RANKX(ALL(PointsByYear[DriverAndYear]),
[Highest points per season],,
DESC, Dense ),
FILTER(ALL('Date'),'Date'[Date] <= MAX('Date'[Date]))

View solution in original post

5 REPLIES 5
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Thanks for reaching out to us.

>> The ranking does work when the animation isn't running. When the animation is running, I only see the rank of the drivers of that particular year

Question1,

vxiaotang_0-1659079009451.png

Question2: when the animation isn't running, what are the output values in your table? Can you take a screenshot?

Question3: What is the animation, is the slicer set? If yes, can you share the sample file? If there is a lot of data in the file, you can simplify it then share. Thank you.

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @v-xiaotang ,
Thanks for your reply. 

 

Question 1: Yes, exactly!

Question 2: 

Rank no animation.pngRank with slicer.png

 

When the animation isn't running, the ranking works just fine. It also works when a slicer is added. 

 

Question 3:

Not sure if I understand your last question, but I am using the visual Play Axis. I've added the link below, so you can check it out yourself:

 

https://drive.google.com/file/d/1PH8jbh5DYKJWM8MHfe8V7C5yxW2Th32N/view?usp=sharing

 

 

 

 

 

Hi @Anonymous 

Thanks for your sample file.

>> When year=1971, DriverAndYear actually has only 54 rows, but the table on the left is obviously much more than 54 rows.

vxiaotang_0-1659342939270.png

So I'm wondering what you're trying to calculate. My understanding is that when the animation goes to 1971, the table should only show 54 items from 1971. As for the table on the left, the rows for other years are shown, which is apparently due to a mismatch caused by the use of incorrect measure.

vxiaotang_1-1659343306576.png

So for 1971, 54 rows, what should the output of Highest points per season be?

vxiaotang_2-1659343492243.png

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@v-xiaotang thanks for your reply! My apology for this late respons; I was on holiday. 

 

The output when the animation is in 1971 should be like this:

Rank example.png

Anonymous
Not applicable

I found the solution for the Rank measure. Apparantly, you also had to filter the date for the Rank measure. 

So, the first measure was this: 

Highest points per season =
CALCULATE(SUM(PointsByYear[PointsbyYear] ),
FILTER(
ALL('Date'),'Date'[Date] <= MAX('Date'[Date]))
 
And the rank measure is as following:
Rank highest points per season =
CALCULATE(RANKX(ALL(PointsByYear[DriverAndYear]),
[Highest points per season],,
DESC, Dense ),
FILTER(ALL('Date'),'Date'[Date] <= MAX('Date'[Date]))

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.