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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
alheita
Frequent Visitor

Conditional Rolling Sum

Hi

 

I am working on a data model that contains transactions from 'n fuel tank, the type of transactions is litres issues, litres received and tank readings. 

 

I am struggling to create a column that displays the tank level closing balance at the time of that transaction, it needs to be a rolling/culimative sum of the tank issues and receipts, but if there is a tank reading it needs to be the tank reading. I also need a second column that displays the value of the difference when a adjustment is made due to the tank reading. 

 

Stock Movement = issues (-) or receipts (+)

Tank Reading = transaction that displays the actual tank level (auto of manual reading)

 

Expected Columns:

Adjustment = Difference between tank reading and previous tank C/B

Tank Level C/B = Tank C/B above plus adjustment plus stock movement

 

Please see example done in excel below, I need a power bi dax version:

 

alheita_1-1666085003814.png

 

 

 

 

3 REPLIES 3
ryan_mayu
Super User
Super User

@alheita 

What's the expected output? It looks like closing balance column only do the accumulation.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi, please see below. I also updated the original post. 

 

This is a excel version of what I need to create in power bi. 

 

alheita_0-1666085163306.png

 

TANK C/B expected = F3+E3+D4, is this formula correct?

if you want to get column E result , you need to have column F value; if you want to get column F result, you need to hae column E value?

that's a circular reference.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors