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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
maynard_savanna
New Member

Sorting a clustered column chart by a value in the y-axis

Hello,

 

I am trying to sort a clustered column chart by the value of the y-axis, but I want it to be for a particular value within the y-axis. I have already tried created a separate table with the two different categories I am looking at and sorting the column order by an identifier that will put the value that I want first.

 

The data fields I am using are:

maynard_savanna_1-1688077570781.png

 

The resultant chart is a clustered bar chart with two different bars for each value on the x-axis. I want to sort the x-axis from highest to lowest using only one of these values (a particular type of "Completion type"); basically, I want to sort the axis by the highest value of one of the bars, not by the total of the two bars. However, I cannot find a way to do this. Here is a picture for reference

maynard_savanna_2-1688077727136.png

Is there any way I can sort this chart by the highest value of the red bars while ignoring the green? But I still want to be able to see the data from the green bars. 

 

 

 

3 REPLIES 3
MFelix
Super User
Super User

Hi @maynard_savanna ,

 

Since you are using the legend the chart will be filtered out by the total values (both of  them) in this case you need to create two metrics one for each completion type then you can do the sorting by any of the completion types.

 

The metric shold be similar to this:

Autogens = CALCULATE(SUM('Table'[Value]), 'Table'[Completion Type] = "Autogens")

Call-ins = CALCULATE(SUM('Table'[Value]), 'Table'[Completion Type] = "Call-Ins")

 

MFelix_0-1688381299652.png

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi Felix,

 

Thank you for you reply.

 

I am having some difficulty getting this solution to work. What "value" are you summing to get the metric for autogens and call-ins? I tried using this formula and got an error because the Completion type is a string of text (either "autogen" or "call-in"). 

 

Should I assign a value to an autogen or call-in using an if statement (if completion type = autogen then value = 1 else if completion type = call-in then value = 2) in a separate column, and then use the metric formula to allow this to work?

Hi @maynard_savanna ,

 

The Value is just a column on my mockup in your case you need to use the column you have for the bars in this case must be a count of the completion type the measure should be something similar to this:

 

Autogens = CALCULATE(Count('Table'[Completion Type]), 'Table'[Completion Type] = "Autogens")

Call-ins = CALCULATE(SUM('Table'[Completion Type]), 'Table'[Completion Type] = "Call-Ins")

 

Rename the table to the one on your model. 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.