Forum Discussion
YTD in Rolling13 months
Hello geniuses,
Can someone help me please to figure out how to make this formula become YTD rolling for 13 months;
"13 month YTD = CALCULATE('Income Periodical'[ValueSelected],DATESINPERIOD(Periods[Date],MAX(Periods[Date]),-13,MONTH))"
The formula above is rolling 13 months with their monthly value, and I want to have a new formula to make a cumulative amount or YTD.
Thank you in advance.
Hi ryan0521
How about this measure
Measure = SUMX FILTER ( ALLSELECTED ( 'date table' ), 'date table'[Date] <= MAX ( 'date table'[Date] ) && DATEDIFF ( 'date table'[Date], MAX ( 'date table'[Date] ), MONTH ) < 13 ) [Measure you want to sum] )Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- v-juanli-msft
Community Support
Hi ryan0521
Create a measure
Measure = CALCULATE ( SUM ( 'main table'[value] ), FILTER ( ALLSELECTED ( 'date table' ), 'date table'[Date] <= MAX ( 'date table'[Date] ) && DATEDIFF ( 'date table'[Date], MAX ( 'date table'[Date] ), MONTH ) < 13 ) )Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- ryan0521Frequent Visitor
It's not working brother v-juanli-msft, The value that I am summing is a result of a Measure,
"CALCULATE('Income Periodical'[ValueSelected],DATESINPERIOD(Periods[Date],MAX(Periods[Date]),-13,MONTH))"
The result from the formula above is the value I want to sum up.
- v-juanli-msft
Community Support
Hi ryan0521
How about this measure
Measure = SUMX FILTER ( ALLSELECTED ( 'date table' ), 'date table'[Date] <= MAX ( 'date table'[Date] ) && DATEDIFF ( 'date table'[Date], MAX ( 'date table'[Date] ), MONTH ) < 13 ) [Measure you want to sum] )Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.