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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I have a table where it has following records
I have a calendar dimension table for on my report and it has one slicer for filter dates. I need to show the ocuppation rate during the priod filter on slicer.
If the slicer stay in 07/01/2019 until 07/31/2019, I can't to use the fields "amount day" where check-out is bigest that 07/31/2019(last 2 lines in the table sample), and I need to calculate the date interval in check-in em max(calendar[date])
I did like this
if (table[checkout].[Date] >= max(calendar[date]);
DATEDIFF(max(calendar[date]);table[checkin];DAY);
table[amount days]
)
But not working, for example, in this first line of the table, it returned 30 days and I don´t know why.
My doubt is, how to compare date in power bi?
is your calendar table marked as a date table?
If it's not it will cause some problems with the built-in time intelligence functions.
Hi Nick, thanks for answering.
I did that you suggested and the problem persit. Look this:
In the highlighted line the date of checkout is biggest 31/07/2019, so the amount of "days ocuppation filter" have to be 7 days(calendar[date] - table[checkin] e not 15 days.
I undestand that my conditional not work:
if (table[checkout].[Date] >= max(calendar[date]);
DATEDIFF(max(calendar[date]);table[checkin];DAY);
table[amount days]
)
Can you upload some sample data?
How I do upload the file .xls in this forum? I could't, so I send this print.
Onedrive or dropbox works.
sorry, follow the link
https://drive.google.com/file/d/1ZzAHDeRtfdSjQIXTxLB7z8Dq-M21zoz7/view?usp=sharing
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
7 | |
5 | |
4 | |
3 |
User | Count |
---|---|
12 | |
11 | |
10 | |
9 | |
8 |