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.
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.
|
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
96 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |