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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.