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.
Hey Guys,
I have a date table and I need to get a formula to get a custom date, such as last Thursday or Monday. Tried WEEKNUM function with max operator as well, did not seem wokring.
Can you please help.
Thanks,
Sona
Solved! Go to Solution.
Hi @Anonymous
you need smth like
Measure =
CALCULATE(MAX(Table[Date]), Table[Date]<TODAY(), WEEKDAY(Table[Date])=4)
Hi @Anonymous ,
Try this code:
Well, if I had a date table and I needed to get last Thursday in a column for example for each date, I would probaby do something along the lines of:
Last Thursday Column =
VAR __Date = 'Calendar'[Date]
VAR __Weeknum = WEEKNUM(__Date)
VAR __PreviousWeekNum = __Weeknum - 1
RETURN
MAXX(FILTER('Calendar',WEEKNUM([Date]) = __PreviousWeekNum && WEEKDAY([Date]) = 5),[Date])
Hi @Anonymous
you need smth like
Measure =
CALCULATE(MAX(Table[Date]), Table[Date]<TODAY(), WEEKDAY(Table[Date])=4)
It worked great. Thanks a lot.
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 |
---|---|
104 | |
96 | |
80 | |
67 | |
62 |
User | Count |
---|---|
138 | |
107 | |
104 | |
82 | |
63 |