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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Daniel71
Frequent Visitor

ISO YTD is working - Need help with ISO YTD minus 1 ISO-year

Hello,

 

I'm using this code to create a YTD-function for ISO Year and weeks taken from https://www.sqlbi.com/articles/week-based-time-intelligence-in-dax/

 
I can't seem to get de code working for IsoYTD minus one Iso-year (or last Iso-year)
 
Gr Daniel
 

IsoYTD :=

IF (

    HASONEVALUE ( Dates[ISO Year] ),

    CALCULATE (

        SUM ( Sales[Sales Amount] ),

        FILTER (

            ALL( Dates ),

            Dates[ISO Year] = VALUES ( Dates[ISO Year] )

                && Dates[Date] <= MAX ( Dates[Date] )

        )

    ),

    BLANK ()

)

1 ACCEPTED SOLUTION
Daniel71
Frequent Visitor

Problem solverd 

IsoYTD :=

IF (

    HASONEVALUE ( Dates[ISO Year] ),

    CALCULATE (

        SUM ( Sales[Sales Amount] ),

        FILTER (

            ALL( Dates ),

            Dates[ISO Year] = VALUES ( Dates[ISO Year] ) - 1

                && Dates[Date] <= MAX ( Dates[Date] )

        )

    ),

    BLANK ()

)

View solution in original post

1 REPLY 1
Daniel71
Frequent Visitor

Problem solverd 

IsoYTD :=

IF (

    HASONEVALUE ( Dates[ISO Year] ),

    CALCULATE (

        SUM ( Sales[Sales Amount] ),

        FILTER (

            ALL( Dates ),

            Dates[ISO Year] = VALUES ( Dates[ISO Year] ) - 1

                && Dates[Date] <= MAX ( Dates[Date] )

        )

    ),

    BLANK ()

)

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors