Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi everyone,
I want to ask a help for solving my problem
I have a table like this
I need to replace the null value with these conditional :
Purchase number= null, Purchase 2 number = null, the status = No Data
Without replace the cell that have been filled
My expectation table like this
What M Code I should write to get my expectations?
Please help me to solve this problem
Thank you..
Solved! Go to Solution.
Hi @Mars3442
Try this
= Table.ReplaceValue(#"PreviousStepName",null,each if [Purchase number]=null and [Purchase 2 number]=null then "No data" else null,Replacer.ReplaceValue,{"Status"})
Have you replaced the name of the previous step between ""? And the column name is "Status"?
For me, it's working perfectly.
Check also that previous line ends with a ",":
#previousStep=.........(.....),
#replaceNull= Table.ReplaceValue...
Oke it works just now
Thank you!
I'm glad it works now!
You're welcome
Hi @Mars3442
Try this
= Table.ReplaceValue(#"PreviousStepName",null,each if [Purchase number]=null and [Purchase 2 number]=null then "No data" else null,Replacer.ReplaceValue,{"Status"})
It returns
Expression.SyntaxError: Token Literal expected.
Table.ReplaceValue(#"PreviousStepName",
------> ^
null,each if [Purchase number]=null and [Purchase 2 number]=null then "No data" else null,Replacer.ReplaceValue,{"Status"})
what should I do?
Have you replaced the name of the previous step between ""? And the column name is "Status"?
For me, it's working perfectly.
Check also that previous line ends with a ",":
#previousStep=.........(.....),
#replaceNull= Table.ReplaceValue...