Forum Discussion

s15's avatar
s15
Helper III
9 years ago
Solved

Display difference in clustered column chart

Hi all,

 

I'm finding a way to display difference between two values in my clustered column chat. I have a measure to calculate the difference but don't know how to integrate it to the chart.

 

 

  • Anonymous's avatar
    Anonymous
    9 years ago

    s15

     

    You need year on the axis to achieve what you want, which is why I proposed a new data structure. 

     

    My measure looks like this:

     

    Population growth =

     

    (CALCULATE(SUM(test[Population]); test[Year]=2014) / CALCULATE(SUM(test[Population]); test[Year]=2000)) - 1

     

    See picture below. There is 2 types of visualizations. One with clustered bar and another one with clustered chart and trend line. If you hover over the columns, you'll see the population growth. 

     

13 Replies

  • Eric_Zhang's avatar
    Eric_Zhang
    Microsoft Employee
    s15 wrote:

    Hi all,

     

    I'm finding a way to display difference between two values in my clustered column chat. I have a measure to calculate the difference but don't know how to integrate it to the chart.

     

     

    s15

    What is your difference measure like? You could probably put the measure to the tooltip field.

    By the way, for me, I'd use a line chart. See more details in the attached pbix file.

    difference =
    CALCULATE (
        DIVIDE (
            SUM ( yourTable[Value] )
                - CALCULATE ( SUM ( yourTable[Value] ), SAMEPERIODLASTYEAR ( 'calendar'[Date] ) ),
            SUM ( yourTable[Value] )
        )
    )
    

     

     

     

    • s15's avatar
      s15
      Helper III

      Eric_Zhang

       

      I just need to display the difference of growth between year 2000 and year 2014. My dataset contains population of Canada in different years. From my example, the growth rate is 13,42% by the measure below

       

      Difference = 1 - (SUM(Population[2000])/SUM(Population[2014]))

       

       

      Displaying the difference is helpful to explain my data.

       

      I drag and drop my measure into Tooltip but nothing changes.

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        s15

         

        Can you show us how you've stored your data?