Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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.
User | Count |
---|---|
128 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |