cancel
Showing results for 
Search instead for 
Did you mean: 
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 ()

)

View solution in original post

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.