Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hey, so a novice here. I dont want the data to be leaked so I have hidden it and marked it with tags though.
Basically what you are looking at is the accuracy data of a classification model. As you can see, for some classes like "A" it predicts all data points correctly, thus it is flagged as True, but we dont have a False column for A because there are no False values. For some reason when we created this table in DAX by grouping a couple of columns and performing the count operation on different table,DAX didnt show False for any values that were completely True.
On the other hand, for "D", 185 values are true and 2 values are false.
We need to showcase this as like a bar chart with maybe a slicer for the different categories. For that we first need the "False" attribute for the values that predicted completely true, then we need to compute the percentage of False and True predictions for each class and then we need to show that in a bar chart.
We are thinking we should pivot the "FLAG" and the "Predicted Values" column for this, and then we will be able to do all the things aforementioned. But because this table was created using DAX from another table, we are unable to find a way to pivot it. It wont evens how up in the Power Query editor. Any tips or help are welcomed. Sorry again, Im a novice so just learning as I work..
Solved! Go to Solution.
Unless I'm misunderstanding your request, the data structure you have should work as it is.
Following Best Practices, I've created dimension tables for flag and category. The main table (fTable in my example) has the structure you posted.
and with the following measures:
Sum P Values =
SUM(fTable[Predicted Values])
% over Category =
VAR _CategoryTotal = CALCULATE([Sum P Values], ALL('Dim Flag'[Flag]))
RETURN
DIVIDE([Sum P Values], _CategoryTotal)
Use the field from Dim category as the slicer and the filed from the Dim Flag for the x -axis, to get:
I've attached the sample PBIX file
Proud to be a Super User!
Paul on Linkedin.
Unless I'm misunderstanding your request, the data structure you have should work as it is.
Following Best Practices, I've created dimension tables for flag and category. The main table (fTable in my example) has the structure you posted.
and with the following measures:
Sum P Values =
SUM(fTable[Predicted Values])
% over Category =
VAR _CategoryTotal = CALCULATE([Sum P Values], ALL('Dim Flag'[Flag]))
RETURN
DIVIDE([Sum P Values], _CategoryTotal)
Use the field from Dim category as the slicer and the filed from the Dim Flag for the x -axis, to get:
I've attached the sample PBIX file
Proud to be a Super User!
Paul on Linkedin.
Thanks a ton!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
79 | |
54 | |
39 | |
35 |
User | Count |
---|---|
102 | |
82 | |
48 | |
48 | |
48 |