Forum Discussion
MEASURE for totals from matrix
- 4 years ago
Hi Gheb_Gabriela ,
For this you need to redo the formula you use for the matrix values. I have used the following data for example:
Now add the following measure to your dataset:
Adjusted Value = IF ( HASONEVALUE ( 'Table'[Cat] ), SUM ( 'Table'[Value] ), SUM ( 'Table'[Value] ) - CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( ALL ( 'Table'[Year], 'Table'[Quarter], 'Table'[Time] ), 'Table'[Year] = SELECTEDVALUE ( 'Table'[Year] ) - 1 && 'Table'[Quarter] = SELECTEDVALUE ( 'Table'[Quarter] ) ) ) )Check PBIX file attach.
Hi Gheb_Gabriela ,
For this you need to redo the formula you use for the matrix values. I have used the following data for example:
Now add the following measure to your dataset:
Adjusted Value =
IF (
HASONEVALUE ( 'Table'[Cat] ),
SUM ( 'Table'[Value] ),
SUM ( 'Table'[Value] )
- CALCULATE (
SUM ( 'Table'[Value] ),
FILTER (
ALL ( 'Table'[Year], 'Table'[Quarter], 'Table'[Time] ),
'Table'[Year]
= SELECTEDVALUE ( 'Table'[Year] ) - 1
&& 'Table'[Quarter] = SELECTEDVALUE ( 'Table'[Quarter] )
)
)
)
Check PBIX file attach.
MFelix Thanks for your solution, it's working for what I need, except that i have blanks instead 0 and everything i've tried it's not working. I have used on your formula +0. Maybe in the pbix that you have attached, you can show me a sollution? To can replace blanks in the matrix with 0?
Have a great day!
- MFelix4 years ago
Super User
Hi Gheb_Gabriela ,
What do you mean by you have blanks instead of 0? In my model the values are also blanks and not 0. Can you please provide further insight on that part?
- Gheb_Gabriela4 years agoFrequent Visitor
Hi MFelix ,
Yes, I know, but your example is just an example, for my report because of the blanks from matrix, if I want to filter only Q1FY19 and Q2FY19, those values with 0 means that i will be not able to see also all the others category ( as is in your example A,B) and i need them to be there even they have 0 value, for my company.
Do you understand what i mean?
Thanks! Appreciate your quick reply
- MFelix4 years ago
Super User
You mean that the matrix lines can be blank correct liken the image below the category dissapears:
In this case best option is to select the visual and on the line values select the option Show items with no Data: