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! Learn more

Reply
Srinivas904
Helper I
Helper I

Urgent Help Needed: DAX Cumulative Value - Exclude Future Months

Hi,

I am using a cumulative formula to calculate volume, as shown in the screenshot below. It is working fine, but I need a small change—I don’t want the cumulative values to be shown for future months.

 

This is the measure I am using. Can anyone please help me with this? Also, just to clarify, we are using a 4-4-5 calendar.

Cumulative YTD QTY =
VAR SelectedYear = SELECTEDVALUE(DIM_TIME[FIN_YEAR])  -- Get the selected year

RETURN
CALCULATE(
    [Volume_V1],
    FILTER(
        ALL(DIM_TIME),
        DIM_TIME[Full_Date] <= MAX(DIM_TIME[Full_Date]) &&
        DIM_TIME[FIN_YEAR] = SelectedYear  -- Restrict to the selected year
    )
)
Srinivas904_0-1740562010694.png


Thanks

Srinivas

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Add a column to your date table to flag whether the month is the current month or before. You could do this in Power Query or DAX, sample DAX is

Current Month or Before =
DIM_TIME[Full_Date] <= EOMONTH ( TODAY (), 0 )

You can then modify your measure to

Cumulative YTD QTY =
IF (
    SELECTEDVALUE ( 'DIM_TIME'[Current Month or Before] ),
    VAR SelectedYear =
        SELECTEDVALUE ( DIM_TIME[FIN_YEAR] ) -- Get the selected year
    RETURN
        CALCULATE (
            [Volume_V1],
            FILTER (
                ALL ( DIM_TIME ),
                DIM_TIME[Full_Date] <= MAX ( DIM_TIME[Full_Date] )
                    && DIM_TIME[FIN_YEAR] = SelectedYear -- Restrict to the selected year
            )
        )
)

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

Add a column to your date table to flag whether the month is the current month or before. You could do this in Power Query or DAX, sample DAX is

Current Month or Before =
DIM_TIME[Full_Date] <= EOMONTH ( TODAY (), 0 )

You can then modify your measure to

Cumulative YTD QTY =
IF (
    SELECTEDVALUE ( 'DIM_TIME'[Current Month or Before] ),
    VAR SelectedYear =
        SELECTEDVALUE ( DIM_TIME[FIN_YEAR] ) -- Get the selected year
    RETURN
        CALCULATE (
            [Volume_V1],
            FILTER (
                ALL ( DIM_TIME ),
                DIM_TIME[Full_Date] <= MAX ( DIM_TIME[Full_Date] )
                    && DIM_TIME[FIN_YEAR] = SelectedYear -- Restrict to the selected year
            )
        )
)

Hi @johnt75 , this is working perfectly as i want, thank you so much. I really appreciate your quick help on this.

 

Helpful resources

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.