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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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