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
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
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