Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
How to write Switch statment if i need determine if date is between months or after date?
Solved! Go to Solution.
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
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
@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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
96 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |