Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
droupa
Frequent Visitor

Help with PY Comparative

Hi,

 

I am trying to compare PY revenue on reservations/booking data, but I want to exclude all the reservations that were booked within in year of the current date of the report being run. This is the formula im using in a visualization, but it shows zero values. 😞

 

PY YTD Total Revenue = sumx(
filter(Reservations,Reservations[Booking Date]<[Booking date PY]),[PY Total Revenue]
)

 

The measures within this formula are shown below:

 

Booking date PY = DATE(YEAR(NOW())-1,MONTH(NOW()), DAY(NOW()))

 

PY Total Revenue = calculate([Total Revenue],SAMEPERIODLASTYEAR('Calendar'[Date]))


Total Revenue = sumx(filter(Reservations,Reservations[Notes2]="Reserved"),Reservations[Revenue ex VAT])

 

Hereis the link to my Power BI file:

Sales report v2

 

Does anyone know what im doing wrong?

 

Many thanks!

 

1 REPLY 1
TeigeGao
Solution Sage
Solution Sage

HI @droupa ,

PLease try to use the following DAX query:

PY YTD Total Revenue = sumx(
filter('Calendar','Calendar'[Date]<[Booking date PY]),[PY Total Revenue]
)

Based on my test, we'd better not using multiple date column in this scenario.

Best Regards,

Teige

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.