Reputation: 49
This is the desired layout of the matrix that I need. I need to have two columns under one column:
However, I ended up with this(I used different values, so the values might be slightly different.):
With the following columns in the matrix fields:
This is a sample of the dataset. Total Units sum up columns A and B. The Order column sorts the Status column:
STATUS A B Total Units Order
ABC 3 0 3 1
DEF 0 6 6 2
ABC 3 2 5 1
ABC 5 6 11 1
GHI 0 4 4 3
ABC 5 3 8 1
DEF 0 9 9 2
How do I get my desired layout? Do I need to pivot the table? Or do I need to group certain values together?
Upvotes: 1
Views: 18896
Reputation: 8148
First, transform your data to this:
Changes I've made:
Then, write 2 DAX measures.
Measure 1:
Units = SUM(Data[Value])
Measure 2:
% = DIVIDE ( [Units], CALCULATE ( [Units], ALL ( Data[STATUS] ) ) )
Then, create a matrix as follows:
Result:
Explanation:
Upvotes: 3