Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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.
Thanks
Srinivas
Solved! Go to Solution.
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
)
)
)
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.