Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello there,
I am calculating employee retention and I need to change the null values in isActive column to be "false" if there's an end date which means the employee left, and "true" if end date is null which means the employee is still active.
this is the code I am using:
#"Replaced Value" = Table.ReplaceValue(#"Replaced OTH",each [isActive],each if [End Date] is null then "true" else [isActive],Replacer.ReplaceValue,{"isActive"})
but it doesn't seem to work.
Any tips?
Solved! Go to Solution.
Hi @salgouda ,
if you enter an equal sign just at the start, the formula should work.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi @salgouda ,
if you enter an equal sign just at the start, the formula should work.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi @salgouda ,
the syntax looks correct. But the screenshot you have posted doesn't match your formula (-"...Copy" columns).
Otherwise: What does the error message says or what exactly is wrong with the current result you are getting?
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi @ImkeF
the original columns are just named isActive, and End Date
When I try to add a new custom step to write this code nothing happens!
it seems like I am missing something but can't figure out what is it?
User | Count |
---|---|
98 | |
87 | |
77 | |
67 | |
63 |
User | Count |
---|---|
110 | |
95 | |
95 | |
64 | |
58 |