Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have some simple excel formulas that I would like to calculate in power query M. The issue I see is that each row is dependent on the outcome of the previous row but that there is also a column dependency as well
Sample file: https://easyupload.io/lf4337
I have already looked at index columns, List.Sum function, etc but I don't get what I'm looking for because of the column dependency.
How can I make this work in power query?
Solved! Go to Solution.
Hi @Fram ,
Sorry for my wrong understanding.
If your Loss is calculated in terms of Total, but your Total is also calculated in terms of Loss, it seems impossible to implement in Power Query.
This is because in Excel, each cell of yours can be treated as an independent operation, not in Power Query.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Fram ,
Here's my solution.
1.Add an index column.
2.Add a custom column as Total.
3.Get the previous row based on Total column. Reference: Value from previous row – Power Query, M language – Trainings, consultancy, tutorials (exceltown.com...
Replace error with blank.
4.After change the type Previous Total to Decimal Number. We can add a custom column to get Loss.
Remove the unneeded columns.
You could download my attachment for details.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Thanks for your contribution. If you compare the values you will see that the result is different, so no solution for me so far.
The issue I see is in step 2: you calculate a custom total, but this one does not include the loss column and it should (for some reason you add the multiplier to the fixed value, while in fact the multiplier in the excel formulae applies to the previous total, with the issue that the previous total again is dependend on the loss of the previous total and the previous previous total).
Hi @Fram ,
Sorry for my wrong understanding.
If your Loss is calculated in terms of Total, but your Total is also calculated in terms of Loss, it seems impossible to implement in Power Query.
This is because in Excel, each cell of yours can be treated as an independent operation, not in Power Query.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
41 | |
24 | |
22 | |
20 | |
13 |
User | Count |
---|---|
159 | |
61 | |
59 | |
28 | |
18 |