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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello!
I want to create a line graph that shows the bookings made for the last year based on today and compare it with the bookings this year, per month.
Basically, I want two lines, one with this years bookings made until today (which is easy), and a second one showing last year booking nr. by month where the bookings were made this day last year.
I have this for now:
LY Resv =
CALCULATE(
COUNTROWS(Reservations),
Reservations[Arrival] = DATESBETWEEN('Date'[Date],DATE(YEAR(TODAY())-1,1,1),DATE(YEAR(TODAY())-1,12,31)),
Reservations[Booked_Date] <= DATE(YEAR(TODAY())-1,TODAY(),TODAY()))
But it doens't work because it requires a T/F statement instead of datesbetween.
Thank you!
DATESBETWEEN returns a table, so try using IN:
LY Resv =
CALCULATE (
COUNTROWS ( Reservations ),
Reservations[Arrival]
IN DATESBETWEEN (
'Date'[Date],
DATE ( YEAR ( TODAY () ) - 1, 1, 1 ),
DATE ( YEAR ( TODAY () ) - 1, 12, 31 )
),
Reservations[Booked_Date]
<= DATE ( YEAR ( TODAY () ) - 1, TODAY (), TODAY () )
)
Proud to be a Super User!