Forum Discussion
Return last nonblank value in matrix visual
- 3 years ago
Hello,
My model based on your table looks like this:
The measure which solves your problem looks like this:
Custom Sum = VAR CurrentMonth = MAX ( Months[date] ) VAR MaxNonBlankMonth = CALCULATE ( MAX ( data[date] ), REMOVEFILTERS ( Months[date] ), Months[date] <= CurrentMonth ) RETURN CALCULATE ( SUM (data[balance]), REMOVEFILTERS ( Months[date] ), Months[date] = MaxNonBlankMonth )Here's the proof that it works:
Should you need some more details, please let me know.
- 3 years ago
Hi,
I have a feeling that there is some more proper way to achieve the result you need, but I can come up with such a proposal:
Custom sum with groups = VAR CustomSums = SUMMARIZE ( Groups, Groups[ZUONR], "CustomSum", [Custom Sum] ) RETURN SUMX (CustomSums, [CustomSum] )This measure is built on top of the yesterday one as you can see.
The model is pretty much the same.
Here is the result:
Hello,
My model based on your table looks like this:
The measure which solves your problem looks like this:
Custom Sum =
VAR CurrentMonth = MAX ( Months[date] )
VAR MaxNonBlankMonth = CALCULATE ( MAX ( data[date] ), REMOVEFILTERS ( Months[date] ), Months[date] <= CurrentMonth )
RETURN CALCULATE ( SUM (data[balance]),
REMOVEFILTERS ( Months[date] ),
Months[date] = MaxNonBlankMonth )
Here's the proof that it works:
Should you need some more details, please let me know.
I have one additional question ... If there is more than 1 categorical variable in that matrix, for example
I need to SUM that groups (Brutto and Reinsurance) also with that repeated values
Is there any solution for this case please?
Table
- barritown3 years ago
Solution Sage
Hi,
I have a feeling that there is some more proper way to achieve the result you need, but I can come up with such a proposal:
Custom sum with groups = VAR CustomSums = SUMMARIZE ( Groups, Groups[ZUONR], "CustomSum", [Custom Sum] ) RETURN SUMX (CustomSums, [CustomSum] )This measure is built on top of the yesterday one as you can see.
The model is pretty much the same.
Here is the result:
- Miro19943 years agoRegular VisitorGreat! Work fine! Thankx