Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Dn_wemn
Helper II
Helper II

Display column value by Rank = 1

Hi,

 

I'd like to create a column or a measure that displays the Sub-Segment value in which the created measure "Rank by Volume" equals 1. It should be displayed on a card visual.

Expected result: So here the card should display "SUV" because it has rank = 1 which is based on highest volume for each Sub-Segment.

 

Sample data:

Sub-SegmentRank by Volume (Measure)Sum of Volume
SUV1200
Car2150
Van3120
PUP4100
MPV590
1 ACCEPTED SOLUTION
Uzi2019
Super User
Super User

Hi @Dn_wemn 

 

You can just simply apply the visual filter on card.

Uzi2019_0-1714973012976.png

 

Just take Sub-Segment value on the card . then open visual filter > add Rank column on visual filter section > put the condition show item when value is 1>apply filter 

 

Uzi2019_1-1714973125613.png

 

 

Every time when your ranking changes it auto changes. 

 

No need to do anything extra.

 

I hope I answered your question!

 

 

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

View solution in original post

7 REPLIES 7
Uzi2019
Super User
Super User

Hi @Dn_wemn 

 

You can just simply apply the visual filter on card.

Uzi2019_0-1714973012976.png

 

Just take Sub-Segment value on the card . then open visual filter > add Rank column on visual filter section > put the condition show item when value is 1>apply filter 

 

Uzi2019_1-1714973125613.png

 

 

Every time when your ranking changes it auto changes. 

 

No need to do anything extra.

 

I hope I answered your question!

 

 

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Hi, I tried this before, but in this case Rank by Volume is a created measure. It does not allow me to filter Rank by volume = 1 in a card visual. I can't open the dropdown to select a filter option.

Dn_wemn_1-1714982277945.png

 

Hi @Dn_wemn 

Yes becasue measure wont work for you. You have to create calculated column for ranking then take ranking column into card filter.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

How would you create the calculated column for rank based on volume amount by Sub-segment in this case? 

Edit: I got it myself.

RANKX(

          FILTER( 'Table',
                'Table'[Sub-segment] = EARLIER('Table'[Sub-segment])
          )
            , 'Table'[Volume]
            ,, DESC,Dense
            )

 

Thanks.

barritown
Super User
Super User

Hi @Dn_wemn,

You can try something like this:

barritown_0-1714935180856.png

In plain text for convenience:

Sub-Segment no 1 = 
VAR _tbl = ADDCOLUMNS ( 'Table', "@Rank", [Rank_measure] )
RETURN MAXX ( FILTER ( _tbl, [@Rank] = 1 ), [Sub-Segment] )

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

 

Hi, it does not show SUV when I tried it: 

Dn_wemn_0-1714982042823.png

 

 

btw, here is my measure for rank by volume:

Rank by Volume = RANKX(
           ALLSELECTED( 'Table'[Sub-Segment])
            , CALCULATE(SUM('Table'[Volume])) 
            )

Hi @Dn_wemn 
You can try my solution without creating measure.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.