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
SebSchoon1
Post Patron
Post Patron

Running Total formula optimization (Run out of memory)

Hi guys,

 

Thanks to you i founded the right formula to calculate my Stock image.

 

Because sometimes it works sometimes it runs out of memory...

 

Here's the formula.

 

1-RT STOCK pas mal 2 =

VAR _selecteddate = SELECTEDVALUE('Calendrier (début)'[Date])
VAR _datemax = CALCULATE(MAX('Calendrier (début)'[Date]), ALL ('BDD - Lignes de mouvements'))

RETURN
IF( _selecteddate> _datemax,BLANK(),CALCULATE('1-Mesures sur mouvements de stock'[Test aggregation stock],ALL('Calendrier (début)'[Date]),'Calendrier (début)'[Date] <= _selecteddate))
 
I would like the formula to avoid showing data per date where theres 0 in total for that day.
 
Thanks guys !!
3 REPLIES 3
Anonymous
Not applicable

Hi @SebSchoon1,

Can you please share a pbix or some dummy data that keep raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Hi  @Anonymous 

 

i would like to use a second calendar on that formula, with the Userelationship

but i don't no where to put it.

 

i don't no why the result is not as expected

SebSchoon1
Post Patron
Post Patron

I added a condition,

 

But it does not seems to be more efficient.

 

1-RT STOCK pas mal 2 =

VAR _selecteddate = SELECTEDVALUE('Calendrier (début)'[Date])
VAR _datemax = CALCULATE(MAX('Calendrier (début)'[Date]), ALL ('BDD - Lignes de mouvements'))

RETURN
if(IF(_selecteddate> _datemax,BLANK(),CALCULATE('1-Mesures sur mouvements de stock'[Test aggregation stock],ALL('Calendrier (début)'[Date]),'Calendrier (début)'[Date] <= _selecteddate))=0,BLANK(),IF(_selecteddate> _datemax,BLANK(),CALCULATE('1-Mesures sur mouvements de stock'[Test aggregation stock],ALL('Calendrier (début)'[Date]),'Calendrier (début)'[Date] <= _selecteddate)))

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.

Top Solution Authors