cancel
Showing results for
Did you mean:
Highlighted
Frequent Visitor

## Multiple calculated columns in single iteration of Loop

Hello Everyone,

Please refer to the below data table.

 Flag X Y A B 0 100 200 100 3700 0 200 400 200 3700 1 300 0 0 3400 0 400 600 400 3400 0 500 200 500 3400 1 200 0 0 3200 0 100 400 100 3200 0 400 100 400 3200 0 300 400 300 3200 0 700 300 700 3200 1 100 0 0 3100 0 400 600 400 3100

 I am trying to calculate value in column B using below logic. Step 1 = Copy Data from Column X into Column A. Step 2 = The first value in the column B should be the total of column A. Step 3 = Check Flag,If it is 1 then replace respective value in column A with respective value in Y Column. Step 4 = Once the value is replaced,sum of the column A should be calculated in column B. Step 5 = If flag is 0,the value in column B should be the earlier calculated value. Steps 3 , 4 & 5 above should execute in same iteration of loop or with the help of supporting columns. Can anyone help me with the DAX for above logic. Thanks.
Community Support Team

## Re: Multiple calculated columns in single iteration of Loop

I'm a little confused by your description, could you please use the sample show how to get the expected output?

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements