Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
11 | |
9 | |
6 |