Forum Discussion
If date between months
How to write Switch statment if i need determine if date is between months or after date?
Hi Analitika ,
Please refer to the measure below:
Measure = SWITCH ( TRUE (), MAX ( Klients[klient] ) = "JSC4" && MAX ( 'Date'[Date] ) <= DATE ( 2017, 12, 31 ) && MAX ( 'Date'[Date] ) >= DATE ( 2017, 1, 1 ), App, MAX ( Klients[klient] ) = "JSC4" && MAX ( 'Date'[sort_month] ) / 100 + MAX ( 'Date'[YEAR] ) >= 2019.11, 0, DIVIDE ( Percent0, 100 ) )If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
2 Replies
- amitchandakSuper User
Analitika , The information you have provided is not making the problem clear to me. Can you please explain with an example.
I have this column example.
Month Type = Switch( True(),
Date([Date]) = eomonth(Today(),-1),"Last Month" , //Last Month
Date([Date])= eomonth(Today(),0),"This Month" , //This Month
[Month Year]
)In case of measure , you case >= and < = Date(2018,01,01) or date from slicer
Month Type = Switch( True(),
Max(Date([Date])) = eomonth(Today(),-1),"Last Month" , //Last Month
Max(Date([Date]))= eomonth(Today(),0),"This Month" , //This Month
[Month Year]
)
Appreciate your Kudos. - v-deddai1-msftCommunity Support
Hi Analitika ,
Please refer to the measure below:
Measure = SWITCH ( TRUE (), MAX ( Klients[klient] ) = "JSC4" && MAX ( 'Date'[Date] ) <= DATE ( 2017, 12, 31 ) && MAX ( 'Date'[Date] ) >= DATE ( 2017, 1, 1 ), App, MAX ( Klients[klient] ) = "JSC4" && MAX ( 'Date'[sort_month] ) / 100 + MAX ( 'Date'[YEAR] ) >= 2019.11, 0, DIVIDE ( Percent0, 100 ) )If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai