Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Creating Comparison Bar Chart - Multiple Categories (using measures)

I need to create a graph that shows comparison of several categories between 2 periods (Q1 and Q2 2023)

 

So I created measures to calculate averages of columns in Table 1 (Q1 2023) and Table 2 (Q2 2023)

 

Example:

Table 1

A Q1 2023 average measure

B Q1 2023 average measure

...

Table 1

A Q2 2023 average measure

B Q2 2023 average measure

...

On a simple table, it will look like this:

 

Category2023 Q12023 Q2
A8.697.69
B8.577.57
C8.137.13
D8.347.34
E8.47.4
F8.77.7
G8.797.79
H8.577.57
I8.777.77
J8.447.44
K9.038.03
L8.77.7
M8.47.4
N8.517.51
O8.837.83
P8.837.83

 

Now, I want to create one graph that will look like this using the measures, but it's just lumping in all the bars:

 

 

I cannot think of how to put it this way. Should I create a separate table that calls the categories  and their values (and how)? I don't know how to begin doing it.

2 Replies

  • Hi Anonymous ,

    According to your description, I create a sample to reproduce the problem.

    Table1:

    Table2:

    I create two measures:

    2023 Q1 = AVERAGE(Table1[Q1 2023])
    2023 Q2 = AVERAGE(Table2[Q2 2023])

    In a clustered column chart, put Category in X-axis and the two measures in Y-axis, get the result:

    Is this your expected result? I attach my sample below for your reference.

     

    Best regards,

    Community Support Team_yanjiang

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

    • Anonymous's avatar
      Anonymous
      Not applicable

      Actually, the Categories A-Z are actually columns in each of my two tables, with 1-10 values.

       

      For example:

       

      Table 1         
      CountryLocationABCDEFGH
      USNew York86558865
      PhilippinesManila74647746
      PhilippinesManila63765637
      USCalifornia44574445
      UKLondon58233582
      AfricaJohannesburg7810857810
      USNew York89298892
      UKIreland96879968
      AustraliaSydney1074621074

       

       

      Table 2         
      CountryLocationABCDEFGH
      Latin AmericaBrazil87645789
      Latin AmericaMexico64348896
      AustraliaMelbourne567521028
      New ZealandNew Zealand54673897
      EMEAGreece87543589
      EMEAFrance87645789
      USNew York64348896
      EMEAGreece567521028
      AustraliaSydney1074621074

       

      The measures I created were Q1 A, Q1 B, etc etc. then Q2 A, Q2 B. But when I'm creating a graph, it doesnt show that way. They are all lumped together.

       

      The measures I created, if I put it in excel, will look like this: