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
PBIfanatic
Helper V
Helper V

Rank without measure.

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

 

 

 

 

 

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Picture2.png

 

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.


Go to My LinkedIn Page


View solution in original post

6 REPLIES 6
smpa01
Super User
Super User

@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.

 

smpa01_0-1634239230312.png

 

_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

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
PBIfanatic
Helper V
Helper V

Hi @Jihwan_Kim

thanks for replying, I get 1 in all rows for Rank CC, not the ranking. 

 

 

 

 

 

Hi,  @PBIfanatic 

Regarding the sample data you provided, I did not find any errors in @Jihwan_Kim  formula.

91.png

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.


Go to My LinkedIn Page


Jihwan_Kim
Super User
Super User

Picture2.png

 

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.


Go to My LinkedIn Page


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.

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.