Forum Discussion
Different measures in Matrix visual
- 1 year ago
Hi Manish1198 ,
For this you need to create a separate table with the category and the measure names:
The order column is to set the order how you want to have the measures.
Now add the following two measures:
Values = CALCULATE( SWITCH(SELECTEDVALUE('Marix Visualization'[Order]), 1, [SalesForConsumer], 2, SUM(Orders[Sales]), 3, SUM(Orders[Profit]), 4, SUM(Orders[Quantity])), Orders[Category] in VALUES('Marix Visualization'[Category])) Formatting = SWITCH( TRUE(), SELECTEDVALUE('Marix Visualization'[Order]) = 2 && [SalesForConsumer] < 5000 , 0, SELECTEDVALUE('Marix Visualization'[Order]) = 2 && [SalesForConsumer] >= 5000 , 1, SELECTEDVALUE('Marix Visualization'[Order]) = 4 && [SalesForConsumer] < 10 , 0, SELECTEDVALUE('Marix Visualization'[Order]) = 4 && [SalesForConsumer] >= 10 , 1)Now create your matrix with the Category and Measure on the columns and place the Values measure on the measures.
Use the condittional formatting with a rule for the formmating measure:
See file attach.
- 1 year ago
Hi Manish1198
Apologies you are correct do the following update to the measure:
Values = CALCULATE( SWITCH(SELECTEDVALUE('Marix Visualization'[Order]), 1, [SalesForConsumer], 2, SUM(Orders[Sales]), 3, SUM(Orders[Profit]), 4, SUM(Orders[Quantity]) ), 'Marix Visualization'[Category] = SELECTEDVALUE('Calculation group'[Category]))I also updated the matrix table acordingly.
Awesome MFelix Thanks for sharing your knowledge.
MFelix does this by any chance work with calculated groups? This isn't working as expected when i use calculated groups in place of Orders[Category] .
Values = CALCULATE( SWITCH(SELECTEDVALUE('Marix Visualization'[Order]),
1, [SalesForConsumer],
2, SUM(Orders[Sales]),
3, SUM(Orders[Profit]),
4, SUM(Orders[Quantity])),
'Calculation group'[Category] in VALUES('Marix Visualization'[Category]))
Please see the file File
Thanks
- MFelix1 year agoSuper User
Hi Manish1198 ,
Hi Manish1198 ,
In this case you need to remove the calculate and filter part from the measure since you are forcing the filter trough the calculaiton group:
Values = SWITCH(SELECTEDVALUE('Marix Visualization'[Order]), 1, [SalesForConsumer], 2, SUM(Orders[Sales]), 3, SUM(Orders[Profit]), 4, SUM(Orders[Quantity]) )- Manish11981 year agoHelper I
MFelix Do you mean all measures will be shown when we use calculated group? can't we show few measures in one category and other measures in other category?
Ex: Can we show the following when using Calculation group[Category]
Sales, Profit, Quantity in Office Supplies;
SalesforConsumer, Sales, Profit in Technology;
Sales, Profit, Quantity in Furniture category.- MFelix1 year agoSuper User
Hi Manish1198
Apologies you are correct do the following update to the measure:
Values = CALCULATE( SWITCH(SELECTEDVALUE('Marix Visualization'[Order]), 1, [SalesForConsumer], 2, SUM(Orders[Sales]), 3, SUM(Orders[Profit]), 4, SUM(Orders[Quantity]) ), 'Marix Visualization'[Category] = SELECTEDVALUE('Calculation group'[Category]))I also updated the matrix table acordingly.