Forum Discussion
% Diff by Category
Hello, I am a novice at DAX and am looking for help on create a percent diff measure based on category.
Here's the raw data
| System | RunTime |
| A | 5 |
| B | 7 |
Here's what I am like to do
| System | A | B | % Diff |
| RunTime | 5 | 7 | 71% |
This is super easy in Excel but PowerBI is a different animal.
Thanks
- Anonymous4 years ago
Hi Anonymous ,
First, Transform data>>Transform>>Transpose>>use first row as headers
Then create a measure.
%diff = SELECTEDVALUE('Table'[A])/SELECTEDVALUE('Table'[B])If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards
Community Support Team _ Polly
2 Replies
- MFelixSuper User
Hi Anonymous
Try the following
% difference =
DIVIDE (
CALCULATE ( SUM ( Table[Runtime] ), Table[System] = "A" ),
CALCULATE ( SUM ( Table[Runtime] ), Table[System] = "B" )
)Be aware that if you want a dinamic approach this needs to be changed and the values of each of the system need to be a formula also.
- AnonymousNot applicable
Hi Anonymous ,
First, Transform data>>Transform>>Transpose>>use first row as headers
Then create a measure.
%diff = SELECTEDVALUE('Table'[A])/SELECTEDVALUE('Table'[B])If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards
Community Support Team _ Polly