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
mherring
Regular Visitor

Display Ranks on X-axis Dynamically

1. I'd like to display rankings (1,2,3,4, etc) across the x-axis of a line chart, with the volume (e.g. Sales) on the y-axis. 

2. I'd like to retain the sort of dynamic ranking allowed by RANKX. E.g. slice by customer, location etc and still get 1,2,3,4 etc. Using a claculated column does not allow for this. 

 

3. I'd like it to perform reasonably well across a large amount of data. My specific goal is ranking hourly volume on a yearly basis (ranks 1 to 8,760) across 15 years. 

 

Below is the output I want, using a calculated column, but I would like to be able to slice it by other attributes and have the rankings update.

 

2017-11-18 22_39_10-04 BOSS and Chroma Demand 18 Nov (002) - Power BI Desktop.png

 

I have attempted this using a disconnected table and it appears to work with small sets of data, but will not work efficiently with 15x8,760 data points. The concept here was that I needed a column to get a value on the axis and I neded the disconnected tbale to make it dynamic. Hoping there is a better option than this.

 

CALCULATE (
[Sales Per Hour], 
FILTER (
ALL ( 'Hour of Year Summary'[Day & Hour] ),
[Rank by Hour of Year] = [MaxRank]
)

Where:

[Sales per hour] - just a SUM

'Hour of Year Summary'[Day & Hour] - is a column of every hour in a year e.g. 1 Jan 1am, 1 Jan 2am 

Rank by Hour of Year is =RANKX ( ALL('Hour of Year Summary'[Day & Hour]), [Sales],,,Dense)

Max Rank is =MaxRank = MAX(Ranking[Rank]) on a table that just lists numbers 1 to 8,760. This table has no relationship to anything else. Then I drag the column Ranking[Rank] from the disconnected table onto the axis.

1 REPLY 1
v-yulgu-msft
Employee
Employee

Hi @mherring,

 

Based on my test, it is not available to display dynamic ranking values on X-axis. Since the ranking value we added to X-axis must be a calculated column rather than measure, however, calculated column is initialized once created. It won't be re-calculated when we change the selection of slicer.

 

You said you could achieve this using a disconnected table with small sets of data, but I still could not work it out based on the formulas you provided. Could you please share the sample data and more deatils about the measures in your scenario? I need to know the table structure.

 

Regards,

Yuliana Gu

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

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.