Forum Discussion
Calculate Iterate Levels in M
Hi Yaroslav__D
Thank you for reaching out to the Microsoft Fabric Forum Community. sorry for delay.
Idea to use Expression.Evaluate is a really good one or Please try the code below. it may helps you. lbendlin Thanks for your inputs.
If the issue persists, feel free to reach out to us. We are happy to assist you.
Table.TransformRows(
currentTable,
(row) =>
if row[Level] <> null then row
else
let
match = Table.SelectRows(DependencyMap, each [TargetAccount] = row[Account]),
sources = if Table.IsEmpty(match) then {} else match{0}[Sources],
allResolved = List.IsEmpty(List.Difference(sources, assignedAccounts))
in
if allResolved then Record.TransformFields(row, {{"Level", each currentLevel + 1}})
else row
)
Hi Yaroslav__D
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.
- v-priyankata1 year agoCommunity Support
Hi Yaroslav__D
Hope everything’s going smoothly on your end. We haven’t heard back from you, so I wanted to check if the issue got sorted. If yes, marking the solution would be awesome for others who might run into the same thing.
- v-priyankata1 year agoCommunity Support
Hi Yaroslav__D
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. Please contact the community for any issues you may have. We are happy to assist you.