Forum Discussion
Customized Matrix & SUM function & Customized Subtotals
- 5 years ago
Hi Anonymous,
could you try this for A+C:
A+C = SUMX(FILTER(ALLSELECTED(Input), Input[Letter] = "A" || Input[Letter] = "C"), Input[Value])Did this answer your question? Mark my post as a solution!
Thank you for your reply,
unfortunately it doesn't work 😞
Hi Anonymous,
could you try this for A+C:
A+C = SUMX(FILTER(ALLSELECTED(Input), Input[Letter] = "A" || Input[Letter] = "C"), Input[Value])Did this answer your question? Mark my post as a solution!
- Anonymous5 years agoNot applicable
Markus_Re
It works great!Could you advice me how to approach next issue
I would like to have this kind of matrixwhere A+C is the sum of both A and C but considering the category One, Two, ....
Currently there are no other values so the results will be
A+C | 2 4 6 0- Markus_Re5 years agoResolver I
Hi Anonymous,
Here is how I would solve this:
Create a third table that includes Value and discription (just like the table "Category), but this table has no active relation to any other table (in my case called ValueDescription). The tables can´t be related because of the fact, that for the Category A+C no values exist in the Input-Table and so the Measure A+C in connection with the new table will never return any values:To build the visual I used this columns: Category[Category] in Rows, ValueDescription[Description] in Columns, and [Values for Matrix] in the Values-Section.
For this to work all the Measures have to be changed like the following:
For example A (B,C):
A =
IF(HASONEVALUE(ValueDescription[Description]),
SUMX(FILTER(ALLSELECTED(Input), Input[Letter] = "A" && Input[Description] = SELECTEDVALUE(ValueDescription[Description])), Input[Value]),
SUMX(FILTER(ALLSELECTED(Input), Input[Letter] = "A"), Input[Value]))
and A+C:A+C =
IF(HASONEVALUE(ValueDescription[Description]),
SUMX(FILTER(ALLSELECTED(Input), (Input[Letter] = "A" || Input[Letter] = "C") && Input[Description] = SELECTEDVALUE(ValueDescription[Description])), Input[Value]),
SUMX(FILTER(ALLSELECTED(Input), Input[Letter] = "A" || Input[Letter] = "C"), Input[Value]))
This change is necessary because as described above, we can´t enable a relation between Input and ValueDescription. All it does is, it checks if a single ValueDescription is Selected and if so it returns only the Sum of the Selected Description