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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
meikev
New Member

replace EndOfYear parameter with column value

Spoiler
Trying to update the TotalTYD function parameter for YearEndDate with a value from another column (that can be updated by the user).
YTD WIP Total Fees = TOTALYTD(SUM(Perspectives[WIP Total Fees]),'date'[date],"31 Mar")

want to replace the 31 Mar with a column that a user can then update for their own requirements

YTD WIP Total Fees = TOTALYTD(SUM(Perspectives[WIP Total Fees]),'date'[date],Table[EOY])


1 ACCEPTED SOLUTION

Hi @meikev ,

 

We can try to use a calculated table and a measure to meet your requirement:

 

Calculated table:

Table = ADDCOLUMNS ( CALENDARAUTO (), "EOY", FORMAT ( [Date], "DD MMM" ) )

 

Measure:

YTD WIP Total Fees =
VAR endDate =
    MAX ( 'Perspectives'[Date] )
VAR startDate =
    CALCULATE ( MAX ( 'Table'[Date] ), 'Table'[Date] <= endDate )
RETURN
    CALCULATE (
        SUM ( 'Perspectives'[WIP Total Fees] ),
        FILTER (
            ALLSELECTED ( 'Perspectives' ),
            'Perspectives'[Date] >= startDate
                && 'Perspectives'[Date] <= endDate
        )
    )

 

5.jpg6.jpg


If it doesn't meet your requirement, Could you please show the exact expected result based on the Tables that we have shared?


By the way, PBIX file as attached.


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

Genrally, you would use a What If parameter and associated measure to do that.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

a What-if parmater can only be numeric (whole/decimal) - this function requires a string argument that equates to a date

 

Hi @meikev ,

 

We can try to use a calculated table and a measure to meet your requirement:

 

Calculated table:

Table = ADDCOLUMNS ( CALENDARAUTO (), "EOY", FORMAT ( [Date], "DD MMM" ) )

 

Measure:

YTD WIP Total Fees =
VAR endDate =
    MAX ( 'Perspectives'[Date] )
VAR startDate =
    CALCULATE ( MAX ( 'Table'[Date] ), 'Table'[Date] <= endDate )
RETURN
    CALCULATE (
        SUM ( 'Perspectives'[WIP Total Fees] ),
        FILTER (
            ALLSELECTED ( 'Perspectives' ),
            'Perspectives'[Date] >= startDate
                && 'Perspectives'[Date] <= endDate
        )
    )

 

5.jpg6.jpg


If it doesn't meet your requirement, Could you please show the exact expected result based on the Tables that we have shared?


By the way, PBIX file as attached.


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.