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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Trying2Excel
Helper I
Helper I

YTD Measure Not Working

I am trying to calculate YTD with the formula below. It looks like the Total line is just pulling the latest value. Also below are my table connections of one to many on a date table. Please help.

 

Trying2Excel_0-1738248584833.png

 

Trying2Excel_2-1738248610070.png

Trying2Excel_3-1738248628340.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Trying2Excel 

 

It looks like the YTD calculations are also incorrect.

Please try this:

MEASURE =
VAR _currentYear =
    YEAR ( MAX ( 'Reductions Table'[Date] ) )
VAR _currentMonth =
    MONTH ( MAX ( 'Reductions Table'[Date] ) )
RETURN
    IF (
        ISINSCOPE ( Reductions Table[Date].[Year] ),
        CALCULATE (
            SUM ( Reductions Table[Reduction2] ),
            FILTER (
                ALLSELECTED ( Reductions Table ),
                YEAR ( 'Reductions Table'[Date] ) = _currentYear
                    && MONTH ( 'Reductions Table'[Date] ) <= _currentMonth
            )
        ),
        CALCULATE (
            SUM ( 'Reductions Table'[Reduction2] ),
            FILTER (
                ALLSELECTED ( Reductions Table ),
                MONTH ( 'Reductions Table'[Date] ) <= _currentMonth
            )
        )
    )

 

Hope this can help,

 

 

Best Regards

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

2 REPLIES 2
Anonymous
Not applicable

Hi @Trying2Excel 

 

It looks like the YTD calculations are also incorrect.

Please try this:

MEASURE =
VAR _currentYear =
    YEAR ( MAX ( 'Reductions Table'[Date] ) )
VAR _currentMonth =
    MONTH ( MAX ( 'Reductions Table'[Date] ) )
RETURN
    IF (
        ISINSCOPE ( Reductions Table[Date].[Year] ),
        CALCULATE (
            SUM ( Reductions Table[Reduction2] ),
            FILTER (
                ALLSELECTED ( Reductions Table ),
                YEAR ( 'Reductions Table'[Date] ) = _currentYear
                    && MONTH ( 'Reductions Table'[Date] ) <= _currentMonth
            )
        ),
        CALCULATE (
            SUM ( 'Reductions Table'[Reduction2] ),
            FILTER (
                ALLSELECTED ( Reductions Table ),
                MONTH ( 'Reductions Table'[Date] ) <= _currentMonth
            )
        )
    )

 

Hope this can help,

 

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

That worked! Thank you so much!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.