Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
I'm new to Power Bi and I'm trying to calculate a % from 2 colums (Made & Missed) in a table but am struggling to figure out how to do it.
I've listed some examples below .
Tackles Made Tackles Missed Tackles Made % (% of total tackles attempted)
10 2 83.3%
12 0 100%
4 1 80%
7 4 63.6%
Any help would be greatly appreciated.
Cheers
J
Solved! Go to Solution.
@jamieham , try like
Measure =
divide(sum(Table[Tackles Made]),sumx(Table,Table[Tackles Missed]+Table[Tackles Made]))
Hey @jamieham ,
I created a calculated column (https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-tutorial-create-calculated-columns) using this DAX statement:
Tackles Made % =
ROUND(
DIVIDE('Table'[Tackles Made] , ('Table'[Tackles Made] + 'Table'[Tackles Missed]) , 0)
, 4
) * 100
The table:
But (as always), there is a problem with calculating ratios using calculated columns as the single numbers (each row) be added in the total line, e.g. using a table visual. For this reason, I recommend to create a measure instead:
I use this DAX statement to create a measure (https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-tutorial-create-measures😞
Measure =
AVERAGEX(
'Table'
, ROUND(
DIVIDE('Table'[Tackles Made] , 'Table'[Tackles Made] + 'Table'[Tackles Missed] , 0)
, 4) * 100
)
Using everything in a table visual makes the difference between calculated columns and measure apparent:
Hopefully, this provides what you are looking for.
Regards,
Tom
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 40 | |
| 37 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 69 | |
| 67 | |
| 34 | |
| 33 | |
| 30 |