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
DebbieE
Community Champion
Community Champion

Sort by a value NOT in the visualisation

 I have a simple bar chart with 3 values in it. Likes Retweets and URL Clicks. I want to sort by the total of all 3. Not by a single value. I dont want the total in the bar chart.

 

I tried creating a new column Likes+Retweets+URL_Clicks but I cant figure out how to sort by it. I tried clicking likes and then going to Modelling Sort By column and changing it to this new column but i gete the message

 

We cant sort the Likes column by [NewColumn] There cant be more than one value in [NewColumn] for the same value in Likes.

Is there any way of doing this?

 

Thanks in advance

 

1 ACCEPTED SOLUTION

@DebbieE Please add a new column as "Total" in the table

 

Total = Test22ChartSort[Likes] + Test22ChartSort[ReTweets] + Test22ChartSort[URLClicks]

Then select "Tweet" field and change "Sort By Column" to Total, as below

 

image.png

 

Now here is the expected output sorted by total which is not present on the chart.

 

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

4 REPLIES 4
PattemManohar
Community Champion
Community Champion

@DebbieE Any sample data and expected output will be really helpful to solve your issue quicker.





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




So I have

 

Tweet Likes Retweets URL Clicks

A        14     6              10

B        1       5               4

C        20     6              1

D       25      16            1

 

This is i a bar chart. Axis Tweet Text  Likes Retweets and URL Clicks as values.

I want to sort so the tweet with the most Likes Retweets and URL clicks put together is at the top. 

I dont want to sort by any of these measures seperately, I want to sort by the total

I dont want this total in as a value in the chart

I cant sort by a value that isnt in the chart or if I can I dont know how to.

@DebbieE Please add a new column as "Total" in the table

 

Total = Test22ChartSort[Likes] + Test22ChartSort[ReTweets] + Test22ChartSort[URLClicks]

Then select "Tweet" field and change "Sort By Column" to Total, as below

 

image.png

 

Now here is the expected output sorted by total which is not present on the chart.

 

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Ive tried this but my only problem is. Total is in the fact table with all the other metrics. The tweet text is in a seperate table.  When you go to Sort by column you can only sort by values in that specific table. Both tables are joined and I dont want the total field in the none fact table.

 

Its a pity you cant Sort by columns in other related tables. 

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.

Top Solution Authors