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
Jit007
Helper I
Helper I

Custom Sorting in measures (legend)

I'm unable to sort the data which comes from calculate measure as per below order,,any idea which steps needs to follow to correct the order

 

Excellent1
Good2
Average3
2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

Create a static reference table in your data model. Keep it disconnected.

 

Feed the visual from the first column, Use the measure to find the selected value and return the associated result.

View solution in original post

11 REPLIES 11
v-junyant-msft
Community Support
Community Support

Hi @Jit007 ,

@lbendlin Thanks for your concern about this case!

I'll detail what @lbendlin means with test data.
Here is my sample data:

vjunyantmsft_0-1715064733987.png

I use this DAX to create the measure:

vjunyantmsft_1-1715064760770.png

Here is the Table(2):

vjunyantmsft_2-1715064826317.png

And use this DAX to create another meaure:

Measure 2 = MINX(FILTER('Table (2)', 'Table (2)'[level] = [Measure]), 'Table (2)'[rank])

Sorting on measure 2:

vjunyantmsft_3-1715064870672.png

But there is a problem with this approach, which is that both measure and measure 2 must exist in your visual object. If you don't want measure 2 to appear in the Table visual object, you can play a little mind trick:

vjunyantmsft_5-1715065209206.png

Then click on the edge of the cell where the measure 2 column header is located and pull it inward until you can't see the column.

vjunyantmsft_6-1715065330502.png

This way, even though measure 2 is no longer visible, both measure and measure 2 still exist in the table.

Best Regards,
Dino Tao
If this post helps, then please consider Accept both of the answers as the solution to help the other members find it more quickly.

Thanks for your response..but the problem is how to show this in line & stacked column chart..there we might face challege.. please suggest @v-junyant-msft @lbendlin 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

I need help to sort by in following order- Excellent >Good >Average

 Thanks @lbendlin @v-junyant-msft 

 

Jit007_1-1715094175477.png

 

Jit007_0-1715094033152.png

Sorting.pbix attached file 

see attached

new Sorting (2).pbix revised file attached..

 

i'm trying to get the out of 100% monthly for ref id data - the total doesn't match to 100%

Thanks in advance @lbendlin 

 

Jit007_0-1715098502732.png

 

like this?

 

lbendlin_0-1715109075650.png

 

like below..Thanks @lbendlin 

 

Jit007_1-1715134071262.png

 

emp idScoreRef IdMonthCat
44951100MarExcellent
44751101MarGood
55851102MarExcellent
551001103MarExcellent
66451104MarAverage
66851105MarExcellent
771001106MarExcellent
77951107AprilExcellent
77501108AprilAverage
88451109AprilAverage
88501110AprilAverage
88651111AprilAverage
991001112AprilExcellent
99501113AprilAverage
99351114AprilAverage
100801115AprilGood
100801116AprilGood

 

Jit007_0-1715133881212.png

 

lbendlin_0-1715204603559.png

 

@lbendlin Many thanks for your help..I'm new to PBI world & still learning. Appreciated your help.

lbendlin
Super User
Super User

Create a static reference table in your data model. Keep it disconnected.

 

Feed the visual from the first column, Use the measure to find the selected value and return the associated result.

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.

Top Solution Authors
Top Kudoed Authors