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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.