Forum Discussion
Horizontal bar chart with multiple measures/colums
Hi,
I got a table like this:
| USER_ID | Question 1 | Question 2 | Question 3 | Question 4 |
| FR_20250501_24 | Yes | Yes | Yes | No |
| FR_20250501_29 | No | No | Yes | Yes |
| FR_20250501_144 | Yes | Yes | No | No |
| FR_20250501_67 | No | No | No | No |
| FR_20250501_64 | No | Yes | Yes | No |
| FR_20250501_27 | No | No | Yes | Yes |
| FR_20250501_159 | Yes | Yes | No | Yes |
| FR_20250501_134 | No | No | Yes | No |
| FR_20250501_68 | Yes | Yes | Yes | Yes |
| FR_20250501_77 | No | Yes | No | Yes |
And I would build a horizontal barchart like this:
Where each bar is the percentage of users saying Yes:
| Yes | No | |
| Question 1 | 40% | 60% |
| Question 2 | 60% | 40% |
| Question 3 | 60% | 40% |
| Question 4 | 50% | 50% |
I created 4 measures like:
Q1_Yes =
DIVIDE(
CALCULATE(
DISTINCTCOUNT(DATA[USER_ID]),
DATA[Question 1] = "Yes"
),
DISTINCTCOUNT(DATA[USER_ID])
)Is it the right approach?
Probably I scould use a measures with VAR and RETURNS or an SVG, could you help me?
Here the .pbix https://we.tl/t-xCUQqnTrE6
Turn your table to this:
And then do this
YES =
DIVIDE(
CALCULATE(
COUNTROWS('Table'),
'Table'[Value] = "YES"
),
COUNTROWS('Table')
)And this
6 Replies
- Tutu_in_YYCSuper User
Turn your table to this:
And then do this
YES =
DIVIDE(
CALCULATE(
COUNTROWS('Table'),
'Table'[Value] = "YES"
),
COUNTROWS('Table')
)And this - BrunoTFrequent Visitor
Here the .pbix https://we.tl/t-xCUQqnTrE6
- v-saisrao-msftCommunity Support
Hi BrunoT,
I wanted to check if you had the opportunity to review the information provided by Ashish_Mathur Tutu_in_YYC . Please feel free to contact us if you have any further questions. If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you. - v-saisrao-msftCommunity Support
Hi BrunoT,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
- v-saisrao-msftCommunity Support
Hi BrunoT,
We haven’t heard back from you regarding your issue. If it has been resolved, please mark the helpful response as the solution and give a ‘Kudos’ to assist others. If you still need support, let us know.
Thank you.
- Ashish_MathurSuper User