Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello!
I have a table that shows data on when visits are created for different buildings and when the visitor has checked-in.
| Building | Visit created on | Check-in time |
| A | 1-08-2023 11:03:00 | 2-08-2023 14:00:00 |
| B | 2-08-2023 12:00:00 | 2-08-2023 13:00:00 |
| C | 4-08-2023 12:02:02 | 4-08-2023 14:00:00 |
| D | 5-08-2023 9:00:05 | 7-08-2023 8:05:00 |
How could I check if a visit has been created after 4PM the previous day the visitor has come in and bring back the amount of such visits?
Thank you in advance!
SQL BI has a good article on how to add/remove date time in measures here:
https://www.sqlbi.com/blog/alberto/2019/03/25/using-dax-with-datetime-values/
You could use variables to store all the things you're comparing. My roundabout guesstimate to get the 4pm the day before for comparison would be to subtract a day from the given date, convert it to date only, then convert it back to date time and add the hours up to 4pm to it. Then you can compare it to the date field in your data and return a true/false if it's greater than or less than the 4pm prior day.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 103 | |
| 80 | |
| 62 | |
| 50 | |
| 45 |