Forum Discussion
Replace all values with 0 in column
- 9 months ago
Hello Anonymous
You can achieve the above scenario using M language in Power Query.Go to Power Query Editor → select your table.
Select the “$ Net” column.
- Go to the Formula Bar and replace the current step for $ Net with this custom logic as follows:
= Table.TransformColumns(
PreviousStepName,
{{"$ Net", each if [Company] = "A" then 0 else _, type number}}
)
Hope, I answered/resolved your query. Please give some kudos and mark this post as "Accepted Solution" if you find it useful.
Hello Anonymous
You can achieve the above scenario using M language in Power Query.
Go to Power Query Editor → select your table.
Select the “$ Net” column.
- Go to the Formula Bar and replace the current step for $ Net with this custom logic as follows:
= Table.TransformColumns(
PreviousStepName,
{{"$ Net", each if [Company] = "A" then 0 else _, type number}}
)
Hope, I answered/resolved your query. Please give some kudos and mark this post as "Accepted Solution" if you find it useful.
Did you test it? I could not get it to work. I did not think you could refer to a different column within Table.TransformColumns transform operation.
- v-tejrama9 months agoCommunity Support
Hi Anonymous ,
I wanted to follow up and see if you had a chance to review the information shared. If you have any further questions or need additional assistance, feel free to reach out.
Thank you.