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

Two variables average over a bar graph.

Hello

 

I want to add several variables to a bar chart. The variables contain values that are between 0 and 10, and I want the chart show the mean of each variable.

 

The label of each bar must be the name of the variable or a custom value, and the value must be the average of the values of that varibale.

 

For example, I have two variables, satisfaction and knowledge, with 300 cases each. And the values they contain are between 0 and 10.

 

I need a chart that contains two bars, with the mean of each variable and the labels of the bars being the variable title or custom text.

 

Can it be done?

 

Thank you.

2 ACCEPTED SOLUTIONS
v-yulgu-msft
Employee
Employee

Hi @josegovia,

 

Suppose your source table looks like:

5.PNG

 

You can use a clustered column chart to show the average values for satisfaction and knowledge. But the limitation is that it is not possible to show the label as the name of the variable or a custom value, data labels can only show the numeric values for each bar.

3.PNG

 

As a workaround, you can unpivot the table structure first in query editor mode. Select the [Case type] column, then from Transform menu tab, choose 'Unpivot other columns' from the drop down list 'Pivot Column'. Then, you will get a table as below.

4.PNG

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi @josegovia,

 

To keep the original table structure, you can replicate a new table, then, you can unpivot columns based on this new table.

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yulgu-msft
Employee
Employee

Hi @josegovia,

 

Suppose your source table looks like:

5.PNG

 

You can use a clustered column chart to show the average values for satisfaction and knowledge. But the limitation is that it is not possible to show the label as the name of the variable or a custom value, data labels can only show the numeric values for each bar.

3.PNG

 

As a workaround, you can unpivot the table structure first in query editor mode. Select the [Case type] column, then from Transform menu tab, choose 'Unpivot other columns' from the drop down list 'Pivot Column'. Then, you will get a table as below.

4.PNG

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,

 

This is the same problem I'm facing. I can't select "Averge of Value". My only two options are "Count" or "Distinct Count" or to create a new quick measure.

 

Is the average option in the orinigal post no longer available?

 

Thanks so much!

image.png

 

Thanks for the solution.

 

But three things happen to me:

 

  • The first is that the main table disappears and I would like to keep it because I have more varibales in it.
  • The second is that if I keep the two tables, I understand that they will have to be related so that if I make a filter in some data affect all the graphs.
  • And the third is that I can not select "Average" from the "Value". I only have COUNT and COUNT DISTINT options.

Can you help me with these three questions?

 

Thank you very much.

 

José

Well, I've already solved the first one. I have changed the format of the varibal to "Whole Number".

 

But I need help with the other two.

 

Thank you.

 

Hi @josegovia,

 

To keep the original table structure, you can replicate a new table, then, you can unpivot columns based on this new table.

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.