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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
Microsoft Employee
Microsoft 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
Microsoft Employee
Microsoft 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.
Anonymous
Not applicable

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.