Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have the following scenario that I am hoping somebody can help with?
I have a Power BI report on which I would like to display some set text if today is the last Monday of the Month.
Is there a way I can check if Today() is the last Monday of the current month, if yes display 1 else 0?
The report does not have a date table as the data displayed does not have any dates in it.
Any assitance appreciated.
Solved! Go to Solution.
@msommerf
Oh srry did not read carefully. Please try
=
VAR TodayDate =
TODAY ()
VAR StartOfTheMonth =
EOMONTH ( TodayDate, -1 ) + 1
VAR EndOfTheMonth =
EOMONTH ( TodayDate, 0 )
VAR T1 =
CALENDAR ( StartOfTheMonth, EndOfTheMonth )
VAR T2 =
ADDCOLUMNS ( T1, "@Weekday", WEEKDAY ( [Date], 2 ) )
VAR T3 =
FILTER ( T2, [@Weekday] = 1 )
VAR LastMonday =
MAXX ( T3, [Date] )
RETURN
IF ( TodayDate = LastMonday, 1, 0 )
Won't that only tell me if today is a Monday? It won't tell me if it is the last Monday of the month.
@msommerf
Oh srry did not read carefully. Please try
=
VAR TodayDate =
TODAY ()
VAR StartOfTheMonth =
EOMONTH ( TodayDate, -1 ) + 1
VAR EndOfTheMonth =
EOMONTH ( TodayDate, 0 )
VAR T1 =
CALENDAR ( StartOfTheMonth, EndOfTheMonth )
VAR T2 =
ADDCOLUMNS ( T1, "@Weekday", WEEKDAY ( [Date], 2 ) )
VAR T3 =
FILTER ( T2, [@Weekday] = 1 )
VAR LastMonday =
MAXX ( T3, [Date] )
RETURN
IF ( TodayDate = LastMonday, 1, 0 )
User | Count |
---|---|
50 | |
23 | |
18 | |
18 | |
14 |
User | Count |
---|---|
91 | |
84 | |
43 | |
26 | |
21 |