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.
Solved! Go to Solution.
Hi @TomNorth
Try this:
RankingMeasure = IF ( ISFILTERED ( 'Population 2017'[County] ), RANKX ( ALLSELECTED ( 'Population 2017' ), CALCULATE ( SUM ( 'Population 2017'[Population] ) ), , DESC ), RANKX ( ALL ( 'Population 2017'[Ward Name] ), CALCULATE ( SUM ( 'Population 2017'[Population] ) ), , DESC ) )
Regards,
Cherie
Hi @TomNorth
You may refer to below measure with ALLSELECTED Function. Attached the simplified sample file.Here is the article about RANKX measure for your reference.
Measure = IF ( ISFILTERED ( 'Population 2017'[County] ) || ISFILTERED ( 'Population 2017'[Gender] ), RANKX ( ALLSELECTED ( 'Population 2017' ), CALCULATE ( SUM ( 'Population 2017'[Population] ) ), , DESC ), RANKX ( ALL ( 'Population 2017'[Ward Name] ), CALCULATE ( SUM ( 'Population 2017'[Population] ) ), , DESC ) )
Regards,
Cherie
Thank you for your reply. This nearly works so thank you.
With no slicers applied, I have a rank on wards which is great!
With just county slicers applies, its reducing the wards just to that county with dynamic ranking which again is great!
However, when I click on the Gender slicer, (All, Male or Female) the ranking is reverting back to 1's for every ward.
I try applying the gender slicer on its own e.g. just Female without the county slicer on, and the same thing happens that all ranks show as 1. Not sure if you know what this is? I am using this code, the same as your post:
Measure =
IF (
ISFILTERED ( 'Population 2017'[County] )
|| ISFILTERED ( 'Population 2017'[Gender] ),
RANKX (
ALLSELECTED ( 'Population 2017' ),
CALCULATE ( SUM ( 'Population 2017'[Population] ) ),
,
DESC
),
RANKX (
ALL ( 'Population 2017'[Ward Name] ),
CALCULATE ( SUM ( 'Population 2017'[Population] ) ),
,
DESC
)
)
Hi @TomNorth
Could you share your sample data which could reproduce your scenario?The measure works for my sample data and i don't know what's the difference between your and my data.You can also upload the pbix file to OneDrive and post the link here. Do mask sensitive data before uploading.
Regards,
Cherie
Hi @AlB
The values all were the max value. I have added to the file I just uploaded as RankingMeasure2.
Thank you for your help 🙂
HIi @TomNorth
I cannot access the file. Could you share it via onedrive instead of sharepoint?
Regards,
Cherie
Hi @TomNorth
Try this:
RankingMeasure = IF ( ISFILTERED ( 'Population 2017'[County] ), RANKX ( ALLSELECTED ( 'Population 2017' ), CALCULATE ( SUM ( 'Population 2017'[Population] ) ), , DESC ), RANKX ( ALL ( 'Population 2017'[Ward Name] ), CALCULATE ( SUM ( 'Population 2017'[Population] ) ), , DESC ) )
Regards,
Cherie
That works great, thank you so much Cherie 🙂
Change your formula to this one. Use a Measure and not a Column:
Population Rank =
IF (
HASONEVALUE ( 'Population 2017'[Ward Name] ),
RANKX ( ALL ( 'Population 2017'[Ward Name] ), [Total Population] ,,DESC)
)
Hi @TomNorth
Try this for the ranking calculated column:
RankingColumn = RANKX ( 'Population 2017', 'Population 2017'[Population], DESC )
Please give me an example of how the measure will be used. What rows on the matrix you'll be using, what fields on the slicers, etc. I want to get a better idea of what you are attempting before trying to answer.
It would also help if you show the table you have with its columns
If you are to use it in that way, eleiminate the calculated clumn we created earlier and use this mesure instead:
RankingMeasure = RANKX ( CALCULATETABLE ( Table1; ALL ( Table1[Ward]; Table1[Population] ) ); Table1[Population]; SELECTEDVALUE ( Table1[Population] ); DESC )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |