Forum Discussion

rachel_luiz's avatar
rachel_luiz
New Member
5 years ago
Solved

How to include data from two variables in the same chart

How do I put data on a Likert scale (grades 1 to 5) from the same applied research in 2 consecutive years? The sum of all bars (2018 + 2019) gives 100%, but I would like the data for each year to add...
  • v-robertq-msft's avatar
    5 years ago

    Hi, rachel_luiz 

    According to your description and sample picture, I think you want to get the value in the column chart that shows the Percentage of the total group by year. Right? You can achieve this using this measure:

    This is my test data based on your sample picture:

    Value1 =
    
    var _total=
    
    CALCULATE(SUM('Table'[Value]),FILTER(ALLSELECTED('Table'),[Year]=MAX('Table'[Year])))
    
    var _value=
    
    MAX('Table'[Value])
    
    return DIVIDE(_value,_total)

    Then go to the Column chart and replace the Value1 with the field in the “Value”, like this:

    And you can get what you want.

    You can download my test pbix file here

     

    If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

    How to Get Your Question Answered Quickly 

     

    Best Regards,

    Community Support Team _Robert Qin

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