Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am trying to calculate yesterday so I can correctly work with our weird shift schedule. Here is what I have so far.
DateOfInterest =
IF (
HOUR ( NOW () ) >= 0
&& HOUR ( NOW () ) <= 6,
DAY ( TODAY () ) - 1,
DAY ( TODAY () )
)
I'm concerned that this will not correctly handle things at the end/start of a month, but I just can't think of how to correct for that.
Solved! Go to Solution.
Hi,
If you are just interested in the previous datenumber you can simply include the -1 within the DAY funtion.
For example this dax day(1/12/2021-1)
will return 30.
I hope this helps to solve your issue and if it does consider accepting this as a solution!
Proud to be a Super User!
Hi,
If you are just interested in the previous datenumber you can simply include the -1 within the DAY funtion.
For example this dax day(1/12/2021-1)
will return 30.
I hope this helps to solve your issue and if it does consider accepting this as a solution!
Proud to be a Super User!
Thanks for that! I feel kinda stupid for not even thinking to try that. Works great!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
18 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
23 | |
10 | |
10 | |
9 | |
7 |