Forum Discussion
using if function for current month to return text value
- 4 years ago
Hi Anonymous ,
Without seeing an example of your table I can't be sure that what you are trying to do is actually correct, but I think your formula should read like this:
// Add this as a new CUSTOM COLUMN if [Request Status] <> null then [Request Status] else if [Request Status] = null and Date.IsInCurrentMonth([#"Month - Date"]) then "Not Submitted" else "Not due yet"You're mixing up functions in your formula by trying to set the value of [Request Status] to your output text.
The formula above will create a new column containing your desired output.
If you want this to replace values in the [Request Status] column, you will need to use Table.ReplaceValue in a custom step, something like this:
// Add this as a CUSTOM STEP = Table.ReplaceValue( previousStepName, each [Request Status], each if [Request Status] <> null then [Request Status] else if [Request Status] = null and Date.IsInCurrentMonth([#"Month - Date"]) then "Not Submitted" else "Not due yet", Replacer.ReplaceText,{"Request Status"} )Pete
Hi Anonymous ,
Without seeing an example of your table I can't be sure that what you are trying to do is actually correct, but I think your formula should read like this:
// Add this as a new CUSTOM COLUMN
if [Request Status] <> null then [Request Status]
else if [Request Status] = null and Date.IsInCurrentMonth([#"Month - Date"]) then "Not Submitted"
else "Not due yet"
You're mixing up functions in your formula by trying to set the value of [Request Status] to your output text.
The formula above will create a new column containing your desired output.
If you want this to replace values in the [Request Status] column, you will need to use Table.ReplaceValue in a custom step, something like this:
// Add this as a CUSTOM STEP
= Table.ReplaceValue(
previousStepName,
each [Request Status],
each if [Request Status] <> null then [Request Status]
else if [Request Status] = null and Date.IsInCurrentMonth([#"Month - Date"]) then "Not Submitted"
else "Not due yet",
Replacer.ReplaceText,{"Request Status"}
)
Pete
- Anonymous4 years agoNot applicable
I want to replace the blank cells in Request status with wither Not submitted or not due based on the current month.
I hope it is clear and thanks for the support.
- BA_Pete4 years agoSuper User
Hi Anonymous ,
I explained how to do this in my post.
Let me know which bit you are getting stuck at and I'll help you through it.
Pete