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
Priya24
New Member

Need Help with Cumulative Total Calculation Based on Selected Periods

Hello Power BI Community,

 

I'm working on a table visual in Power BI that displays an opening balance column. I've set up a period slicer ranging from 1 to 12. Currently, when I select multiple periods from the slicer, the table visual shows the cumulative total of the opening balance column across all selected periods. For instance, selecting periods 1 and 2 displays the total for both periods combined.

 

However, I would like the table visual to show the cumulative total up to the lowest selected period number instead. For example, if I select periods 1, 3, 4, and 6, I want it to display the cumulative total only up to period 4.

 

Could someone please assist me with writing a DAX measure that achieves this behavior? I appreciate any guidance or insights you can provide.

 

While this works for individual periods, when I am selecting multiple periods or random periods from slicer it is giving me cumulative total in the opening balance column.
For example when I select Period_01, Period_02 and Period_03, it is giving the cumulative value of Bal_Beg_Acct that is 90, but it should be 60.

 

 

 

Priya24_0-1719596867635.png

 

 

Thank you!

1 REPLY 1
Legend_11
Resolver I
Resolver I

CumulativeSalesUpToPreviousPeriod =
VAR LowestSelectedPeriod = MIN('PeriodTable'[PeriodNumber])
VAR PreviousPeriod = LowestSelectedPeriod - 1
VAR CumulativeTotalUpToPreviousPeriod =
CALCULATE(
SUM('YourTable'[Sales]),
FILTER(
ALL('PeriodTable'),
'PeriodTable'[PeriodNumber] <= PreviousPeriod
)
)
RETURN
IF(PreviousPeriod > 0, CumulativeTotalUpToPreviousPeriod, 0)

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.