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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |