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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors