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
LunaLabs
Regular Visitor

How to sort bar chart by only one of two selected values

Hi there,

could u please help me to sort the graph in the picture by only the value related to "08-AGOSTO"?

Now the software is sorting by the sum of the two months. ("Agosto" and "Luglio" are two italian months)

 

order.png

 

Many thanks!

1 ACCEPTED SOLUTION
v-rongtiep-msft
Community Support
Community Support

Hi @LunaLabs ,

 

It seems you are using Legend in the chart and the categories are from same column. In that case, you can not sort the chart by a single category from the column. You might consider to create a measure for each category and add these measures to Vlaue field instead of using Legend column.
For example:

屏幕截图 2021-09-20 101005.png

X = CALCULATE(MAX('Table (4)'[sales]),FILTER('Table (4)','Table (4)'[Category]="x"))
Y = CALCULATE(MAX('Table (4)'[sales]),FILTER('Table (4)','Table (4)'[Category]="y"))

 

屏幕截图 2021-09-20 101213.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Best Regards

Community Support Team _ Polly

 

View solution in original post

2 REPLIES 2
v-rongtiep-msft
Community Support
Community Support

Hi @LunaLabs ,

 

It seems you are using Legend in the chart and the categories are from same column. In that case, you can not sort the chart by a single category from the column. You might consider to create a measure for each category and add these measures to Vlaue field instead of using Legend column.
For example:

屏幕截图 2021-09-20 101005.png

X = CALCULATE(MAX('Table (4)'[sales]),FILTER('Table (4)','Table (4)'[Category]="x"))
Y = CALCULATE(MAX('Table (4)'[sales]),FILTER('Table (4)','Table (4)'[Category]="y"))

 

屏幕截图 2021-09-20 101213.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Best Regards

Community Support Team _ Polly

 

amitchandak
Super User
Super User

@LunaLabs , You can not sort my a legend filtered value. You can create a measure that gives august (Last Month) data and use that on tooltip and try to sort on that

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.