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.
Hi, I have a data file like this:
Zipcode | Label | Value |
12222 | Label 1 | 12 |
12222 | Label 2 | 20 |
11111 | Label 1 | 5 |
11111 | Label 2 | 89 |
What I need is a rank column whichh rankes the labels based on Value WITHIN ALL THE SELECTED (FILETERED ) zipcodes.
Zipcode | Label | Value | Rank |
12222 | Label 1 | 12 | 1 |
12222 | Label 2 | 20 | 2 |
11111 | Label 1 | 5 | 1` |
11111 | Label 2 | 89 | 2 |
This below line work properly ONLY FOR ONE ZIPCODE and is obviosuly static:
I want the same action but for EVERY SELECTED (FILTERED ) zipcode. So I went with this:
But it did not work. It produces the number of selected zipcodes as the rank for every label.
Thanks
Solved! Go to Solution.
Hi @Anonymous ,
You can create a measure as below to get the rank changed dynamically base on slicer selections, please find the details in the attachment.
Rank =
RANKX (
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[Zipcode] = SELECTEDVALUE ( 'Table'[Zipcode] )
),
CALCULATE ( SUM ( 'Table'[Value] ) ),
,
ASC,
DENSE
)
If the above one can't help you get the desired result, please provide some sample data in the table (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
How to upload PBI in Community
Best Regards
Hi @Anonymous ,
You can create a measure as below to get the rank changed dynamically base on slicer selections, please find the details in the attachment.
Rank =
RANKX (
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[Zipcode] = SELECTEDVALUE ( 'Table'[Zipcode] )
),
CALCULATE ( SUM ( 'Table'[Value] ) ),
,
ASC,
DENSE
)
If the above one can't help you get the desired result, please provide some sample data in the table (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
How to upload PBI in Community
Best Regards
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 |
---|---|
12 | |
2 | |
2 | |
1 | |
1 |
User | Count |
---|---|
20 | |
3 | |
2 | |
2 | |
2 |