Forum Discussion
user2134_
3 years agoMicrosoft Employee
How to get difference between two columns using matrix visual
I have a table with treatment and control values, now I am creating a matrix by pivoting at Treatment and Control values. But I am not sure how to get difference between these columns. We have the option in PowerBI to get the Column totals, but how to get the difference?
I have used these in Matix:
Columns: Category
Values: A, B, C
Sample Data:
| Category | A | B | C |
| Treatment | 1 | 2 | 3 |
| Treatment | 1 | 2 | 3 |
| Treatment | 1 | 2 | 3 |
| Treatment | 1 | 2 | 3 |
| Treatment | 1 | 2 | 3 |
| Control | 1 | 2 | 3 |
| Control | 1 | 2 | 3 |
| Control | 1 | 2 | 3 |
| Control | 1 | 2 | 3 |
Expected:
| Treatment | Control | Delta | |
| A | 5 | 4 | 1 |
| B | 10 | 8 | 2 |
| C | 15 | 12 | 3 |
4 Replies
- AhmedxSuper User
Share sample pbix file to help you.
- user2134_Microsoft Employee
Beacause of confidentiality I cannot share it. But you can use that sample data
- user2134_Microsoft Employee
You cannot share the samepl pbix file here
- user2134_Microsoft Employee
Here is the visual which is matix. To get this visual, you just have to enable the option under Values section