Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello everyone,
I'm extremely new to the DAX and coding world and I'm not sure what formula to use for the result i'm after so bear with me while I try to explain this!.
I'm trying to create a simple pie chart showing the overall percentage of positive and negative outcomes of a survey. All the numbers that are "1 or 2" need to come back as negative and "3 or 4" to come back as positive. Im trying to do this across 8 columns and 22 rows as shown in the image below but can't figure out how to do so. Is there a way to do this?
I've also attached an image of how id like the outcome to look like just for a reference if what I said didnt really make sense!
Apologies if i'm in the wrong section or haven't made much sense!
Many thanksThis is the table i have
the outcome that im after
Solved! Go to Solution.
Hi @AB174
If you use Power Query to Unpivot the table you end up with 2 columns (see my file for details)
You can then write 2 measures to count the 'positive' and 'negative' values
Positive = CALCULATE(COUNTROWS('DataTable'), FILTER('DataTable', 'DataTable'[Value] > 2 ))
Negative = CALCULATE(COUNTROWS('DataTable'), FILTER('DataTable', 'DataTable'[Value] < 3 ))
Add these measures to your Donut chart
Regards
Phil
Proud to be a Super User!
Hi @AB174
If you use Power Query to Unpivot the table you end up with 2 columns (see my file for details)
You can then write 2 measures to count the 'positive' and 'negative' values
Positive = CALCULATE(COUNTROWS('DataTable'), FILTER('DataTable', 'DataTable'[Value] > 2 ))
Negative = CALCULATE(COUNTROWS('DataTable'), FILTER('DataTable', 'DataTable'[Value] < 3 ))
Add these measures to your Donut chart
Regards
Phil
Proud to be a Super User!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 128 | |
| 88 | |
| 79 | |
| 67 | |
| 62 |