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.
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 )
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 |
---|---|
56 | |
27 | |
24 | |
14 | |
9 |
User | Count |
---|---|
77 | |
61 | |
47 | |
17 | |
12 |