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,
Is it possible to rank a column without a measure value?
This is what I am trying to achieve.
Column 1 Column2 Rank
Product1 US 1
Product1 UK 2
Product1 AU 3
Product2 Uk 1
Product3 AU 1
Solved! Go to Solution.
Rank CC =
RANKX (
SUMMARIZE (
FILTER ( 'Table', 'Table'[Product] = EARLIER ( 'Table'[Product] ) ),
'Table'[Country]
),
CALCULATE ( MAX ( 'Table'[Country] ) ),
,
DESC
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
@PBIfanatic do you need cal.column / measure?
Ranking within each subset with a RANKX measure indeed requires utilizing another measure inside it to my knowledge.
_rank =
//_maxCountry = MAX('Table'[Column2 ])
VAR _0 = MAX('Table'[Column 1 ])
VAR _1 = RANKX(FILTER(ALLSELECTED('Table'),'Table'[Column 1 ]=_0),[_maxCountry],,ASC)
RETURN _1
Hi, @PBIfanatic
Regarding the sample data you provided, I did not find any errors in @Jihwan_Kim formula.
Please check my attached sample file for more details.
If your problem hasn't been solved, please share more details or related screenshot for further research.
Best Regards,
Community Support Team _ Eason
Hi,
I am not sure if you are using it for a calculated measure or a calculated column.
As clearly shown in the picture, I created a calculated column.
You need different formula if you need a calculated measure.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Rank CC =
RANKX (
SUMMARIZE (
FILTER ( 'Table', 'Table'[Product] = EARLIER ( 'Table'[Product] ) ),
'Table'[Country]
),
CALCULATE ( MAX ( 'Table'[Country] ) ),
,
DESC
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
I am also getting all the values of Rank as 1 and I think the formula is incorrect. Also how will the formula be if the product column contains integer values instead of Text ? Instead of Pro01 if it has 1. Pls let me know. TIA.
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 |
---|---|
114 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |