Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi All,
I am new to power BI and am trying to create card visualization to show percentage for a column. Someone suggested that I would need to create a measure first which then I would pull into card. However, my column is a text one.
For example – the problem I am trying to solve for: the column has two values, male and females….so it sums up both, calculates % and then I display only the females in the card. Any ideas on what would work best?
thanks!
Solved! Go to Solution.
Create a measure
Measure = DIVIDE(COUNTROWS(FILTER(Table, Table[Column1] = "female")), COUNTROWS(Table))
Format the measure as a percentage. Put it on a card.
You can't compare a string to a boolean.
Table[Column1] <> ISBLANK(Table[Column1])
If you do an explicit comparison with blank(), you need to understand that 0 and empty string will also be blank.
That's ok if you understand your data.
Best practice is to use ISBLANK, I think you can write
Create a measure
Measure = DIVIDE(COUNTROWS(FILTER(Table, Table[Column1] = "female")), COUNTROWS(Table))
Format the measure as a percentage. Put it on a card.
Thank you, this helps a lot. I am trying to remove the blanks also. However , I am getting an error with this edit:
Measure = DIVIDE(COUNTROWS(FILTER(Table, Table[Column1] = "female")), COUNTROWS(FILTER(Table, Table[Column1] <> ISBLANK(Table[Column1])))
Any ideas why?
thanks
You can't compare a string to a boolean.
Table[Column1] <> ISBLANK(Table[Column1])
If you do an explicit comparison with blank(), you need to understand that 0 and empty string will also be blank.
That's ok if you understand your data.
Best practice is to use ISBLANK, I think you can write
thank you for the solution and explanation!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
96 | |
94 | |
83 | |
70 | |
65 |
User | Count |
---|---|
118 | |
106 | |
93 | |
79 | |
72 |