The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have a table with two columns, one column has various questions, the other has responses that fall into 3 categories: positive, negative and neutral. I have a clustered column chart with the 'Questions' being the value for the Axis, the 'Categorized Responses' being the Legend, and then the Count of Categorized Responses being a value. This gives me a visual where I can compare the number of positive, negative and neutral responses were received for each question. I'm struggling to create a measure showing the percentage of positive, negative and neutral responses broken out by question.
Solved! Go to Solution.
What you essentially need is a measure that counts number of Positive responses, Neutral, and Negative. Then a separate measure that counts all rows. Lastly you'd have a measure that gets your percentage. When you wish to display this information, you can use the 3 percent measures and the context of the question should contrain the results
These measures need to be done using ALLEXCEPT such that is can take the context of which question it is considering. So i'd be expecting something like:
AllCount = CALCULATE( countrows('YourTable'), ALLEXCEPT('YourTable', 'YourTable'[Question]) ) PositiveCount = CALCULATE( countrows('YourTable'), ALLEXCEPT('YourTable', 'YourTable'[Question]), 'YourTable'[Answer] = "Positive" ) PositivePercent = DIVIDE( [PositiveCount], [AllCount] )
What you essentially need is a measure that counts number of Positive responses, Neutral, and Negative. Then a separate measure that counts all rows. Lastly you'd have a measure that gets your percentage. When you wish to display this information, you can use the 3 percent measures and the context of the question should contrain the results
These measures need to be done using ALLEXCEPT such that is can take the context of which question it is considering. So i'd be expecting something like:
AllCount = CALCULATE( countrows('YourTable'), ALLEXCEPT('YourTable', 'YourTable'[Question]) ) PositiveCount = CALCULATE( countrows('YourTable'), ALLEXCEPT('YourTable', 'YourTable'[Question]), 'YourTable'[Answer] = "Positive" ) PositivePercent = DIVIDE( [PositiveCount], [AllCount] )
Worked like a charm, thanks for your help again!
Okay I'll try that, thanks for the help.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
141 | |
109 | |
108 | |
76 | |
63 |
User | Count |
---|---|
273 | |
129 | |
123 | |
101 | |
91 |