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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
siddharthkapse2
Frequent Visitor

Multiple calculated columns in single iteration of Loop

Hello Everyone, 

Please refer to the below data table.

FlagXYAB
01002001003700
02004002003700
1300003400
04006004003400
05002005003400
1200003200
01004001003200
04001004003200
03004003003200
07003007003200
1100003100
04006004003100

 

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.

 

1 REPLY 1
v-lili6-msft
Community Support
Community Support

hi @siddharthkapse2 

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

Please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.