cancel
Showing results for
Did you mean:
Impactful Individual

How to combine 2 expression to display Jul-Sep 21 ?

Hi All

Month last -3 =
FORMAT (
DATE ( MAX ( 'Date'[YEAR2] ), MONTH ( TODAY () ) - 3, DAY ( TODAY () ) ),
"mmm-yy")

Return :- Jul 21

Month last -1 =
FORMAT (
DATE ( MAX ( 'Date'[YEAR2] ), MONTH ( TODAY () ) - 1, DAY ( TODAY () ) ),
"mmm-yy")

Return :- Sep 21

May i know how to combine above 2 expression into 1 expression , so that it will display Jul-Sep 21 ?

Paul

2 ACCEPTED SOLUTIONS
Super User

MonthRange =
VAR startdate =
EDATE ( TODAY (), - 3 )
VAR enddate =
DATE ( MAX ( 'Date'[Year2] )MONTH ( TODAY () ) - 11 )
RETURN
FORMAT ( startdate"MMM" ) & "-"
FORMAT ( enddate"MMM yy" )

Pat

Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

Super User

You need to change the enddate variable too

VAR enddate =
DATE ( MAX ( 'Date'[Year2] ), MONTH ( TODAY () ) - 4, 1 )

Pat

Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

3 REPLIES 3
Super User

MonthRange =
VAR startdate =
EDATE ( TODAY (), - 3 )
VAR enddate =
DATE ( MAX ( 'Date'[Year2] )MONTH ( TODAY () ) - 11 )
RETURN
FORMAT ( startdate"MMM" ) & "-"
FORMAT ( enddate"MMM yy" )

Pat

Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

Impactful Individual

Thank you very much , it work .

i try to do it for April till June 2021 , it does not work.

Qtr Ptrvious=
VAR startdate =
EDATE ( TODAY (), - 6 )
VAR enddate =
DATE ( MAX ( 'Date'[Year2] ), MONTH ( TODAY () ) - 1, 1 )
RETURN
FORMAT ( startdate, "MMM" ) & "-"
& FORMAT ( enddate, "MMM yy" )

may i know where go wrong ?

Paul

Super User

You need to change the enddate variable too

VAR enddate =
DATE ( MAX ( 'Date'[Year2] ), MONTH ( TODAY () ) - 4, 1 )

Pat

Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

Announcements

Launching new user group features

Learn how to create your own user groups today!