Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
risabhroy_03
Partner - Creator II
Partner - Creator II

Show Values till previous month

I have a table that looks like - 

risabhroy_03_0-1667015356104.png

I have to only show values till the previous month that is till Sept and the rest (Oct, Nov, Dec, Jan, Feb, Mar) should come as 0.

Since values exist for all the months, so it coming but I only want to show till the previous month.

Can anyone help?

2 Replies
vinieme12
Champion III
Champion III

YTD until Previous Month

sum({<Datefield={">=$(=Date(Yearstart(today())))<=$(=Date(MonthEnd(today(),-1)))"}>}Measurefield)

or

To date until previous month

sum({<Datefield={"<=$(=Date(MonthEnd(today(),-1)))"}>}Measurefield)

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
robert99
Specialist III
Specialist III

Have you set up a financial year in script. Say 2022/23 that is linked to April 2022 to march 2023 etc.

My answer will vary if you have or haven't 

I assume you have Monthyear set up in your calendar. And what about MonthsAgo?  You need MonthYear but the rest aren't so important

Example of this is below. Datecanon is just the date you use for a master calendar

Year(Today())-Year(DateCanon) AS [YearsAgo] ,
12*(Year(Today())-Year(DateCanon)) + Month(Today()) - Month(DateCanon) as MonthsAgo,
(Weekend(Today(),0,-2) - Weekend(DateCanon,0,-2))/7 as WeeksAgo ,Today() - DateCanon as DaysAgo,


Week (DateCanon) AS WeekNum,
MonthNAME (DateCanon) ) as MonthYear ,