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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi Guys,
Please, I need urgent help with the DAX function to calculate column H in the below dummy data table. I have mentioned the manual calculation in the Excel table for a better understanding of the ask!
Important to consider :
The Formula should consider Column A, B, C, and D as unique for each row, since as you can see that column H is calculated based on value of a column G in the current row + value of column H in the earlier row (within same model_run, area, date, but earlier time stamp).
Solved! Go to Solution.
Hi, @gandharv
try below
but cross check it before move ahead
Column = var a = FILTER('Table (2)', 'Table (2)'[Model_Run]=EARLIER('Table (2)'[Model_Run]) && 'Table (2)'[Area] = EARLIER('Table (2)'[Area]) && 'Table (2)'[Date] = EARLIER('Table (2)'[Date]) && 'Table (2)'[Time]<= EARLIER('Table (2)'[Time]) ) var b = MINX('Table (2)','Table (2)'[Time]) var d = MINX(FILTER('Table (2)','Table (2)'[Time]=b),'Table (2)'[Price - Cost (Value)]) var c = SUMX(a,'Table (2)'[Price - Cost (Value)])-d return IF(c<0,0,c)
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @gandharv
try below
but cross check it before move ahead
Column = var a = FILTER('Table (2)', 'Table (2)'[Model_Run]=EARLIER('Table (2)'[Model_Run]) && 'Table (2)'[Area] = EARLIER('Table (2)'[Area]) && 'Table (2)'[Date] = EARLIER('Table (2)'[Date]) && 'Table (2)'[Time]<= EARLIER('Table (2)'[Time]) ) var b = MINX('Table (2)','Table (2)'[Time]) var d = MINX(FILTER('Table (2)','Table (2)'[Time]=b),'Table (2)'[Price - Cost (Value)]) var c = SUMX(a,'Table (2)'[Price - Cost (Value)])-d return IF(c<0,0,c)
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.