This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
I have a cloumn and I want to canculate the value in percent relative to the whole table like example I have 500 rows and I have 3 categaries on one field L for loss, A for active and G for.. whaterver, I want to calculate the following G+A/ 500, how can I do this?
Solved! Go to Solution.
Assuming that you've loaded this data into your model in Power BI Desktop, you can create a measure to calculate this value:
Calc = (CALCULATE(COUNTROWS(Results),Results[Result] = "G") + CALCULATE(COUNTROWS(Results),Results[Result] = "A")) / COUNTROWS(Results)
Explanation:
The CALCULATE funtion takes an expression and a filter. In this case, the filter is used to count occurences of "G" and "A". You can sum them and then divide by the total using COUNTROWS.
Thanks,
Sam Lester (MSFT)
Assuming that you've loaded this data into your model in Power BI Desktop, you can create a measure to calculate this value:
Calc = (CALCULATE(COUNTROWS(Results),Results[Result] = "G") + CALCULATE(COUNTROWS(Results),Results[Result] = "A")) / COUNTROWS(Results)
Explanation:
The CALCULATE funtion takes an expression and a filter. In this case, the filter is used to count occurences of "G" and "A". You can sum them and then divide by the total using COUNTROWS.
Thanks,
Sam Lester (MSFT)
Here's an example using 20 rows, with 13 G's and 2 A's, along with the measure formula showing the calculation of 0.75. You could convert this to a percentage if you wanted it to read 75% in this case.
Thanks,
Sam Lester (MSFT)
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 30 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 60 | |
| 48 | |
| 29 | |
| 23 | |
| 23 |