Forum Discussion
AlexJim
4 years agoNew Member
Cumulative rate same month
Hello I'm trying to have a measure that results in the cumulative rate up to the specific year, considering the same months of prior years, as shown below. I found a solution like t...
- 4 years ago
Hi AlexJim ,
Please try this measure:
Measure = VAR _m = MAX ( 'Table'[Date] ) VAR _f = FILTER ( ALLSELECTED ( 'Table' ), YEAR ( [Date] ) = YEAR ( _m ) && MONTH ( [Date] ) = MONTH ( _m ) && [Date] <= _m && [Product] = MAX ( 'Table'[Product] ) ) RETURN PRODUCTX ( _f, [Rate] + 1 )Result:
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
AlexJim
4 years agoNew Member
Very helpful, thanks. I realise I need to split by product as well, but does not seem to filter properly. Sorry for my low level of DAX knowledge.
Thanks
Alex
v-chenwuz-msft
Community Support
4 years agoHi AlexJim ,
Please try this measure:
Measure =
VAR _m =
MAX ( 'Table'[Date] )
VAR _f =
FILTER (
ALLSELECTED ( 'Table' ),
YEAR ( [Date] ) = YEAR ( _m )
&& MONTH ( [Date] ) = MONTH ( _m )
&& [Date] <= _m
&& [Product] = MAX ( 'Table'[Product] )
)
RETURN
PRODUCTX ( _f, [Rate] + 1 )
Result:
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.