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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
abeirne
Helper II
Helper II

Sales at a specific point in time

Hi all, I am working on a measure that calculates reservation charges from the current YTD compared to the YTD same day last year. I want to see amount booked as of this time last year. The time intelligience functions I have seen seem to lump values together. For example, I only want to compare 1/1/2021 through 7/21/2021 with 1/1/2022 through 7/21/2022.  I was thinking something like this but currently this measure is not working:

DATES BETWEEN1 =
CALCULATE(
    MeasureTableQ[Reservation Charges SUM],
    DATESBETWEEN(
        CalendarQ[Date],
        PREVIOUSYEAR(CalendarQ[Date]),
        MAX(CalendarQ[Date])
    )
)

Error Message:
MdxScript(Model) (97, 9) Calculation error in measure 'MeasureTableQ'[DATES BETWEEN1]: A table of multiple values was supplied where a single value was expected.

Would the dates in period function be of any help?
Any help would be greatly appreciated, thanks!
1 ACCEPTED SOLUTION
WinterMist
Impactful Individual
Impactful Individual

@abeirne 

 

The following 3 measures can achieve this.

Hope this is helpful to you.

 

Regards,

Nathan

 

WinterMist_0-1658451237030.pngWinterMist_1-1658451291304.png

 

WinterMist_2-1658451320979.png

 

WinterMist_5-1658451550213.png

 

View solution in original post

1 REPLY 1
WinterMist
Impactful Individual
Impactful Individual

@abeirne 

 

The following 3 measures can achieve this.

Hope this is helpful to you.

 

Regards,

Nathan

 

WinterMist_0-1658451237030.pngWinterMist_1-1658451291304.png

 

WinterMist_2-1658451320979.png

 

WinterMist_5-1658451550213.png

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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