Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Fabric community is upgrading! Read all of the details including the timeline and what you can expect. Learn more

Reply
Anonymous
Not applicable

using if function for current month to return text value

I have status cloumn that has  the status of each rpocess I review on monthly basis. however, since we are in the begining of the year, the status would result to NULL because the relvant processes have not been yet submitted either because they are late or because it is not due yet. Therefore, I was trying to make the culumn replace the NULL based on the current month, where if the table shows the current month and it was empty it should replacle it to "Not submitted yet" otherwise it should return it as "Not due yet". 

 

When trying thre below formua the synatx is right, but it return in Error 

 

I would appreciate the support to fix this.

 

 

if[Request Status] = "" and [#"Month - Date"] = Date.IsInCurrentMonth then [Request Status] = "Not submitted" else [Request Status] = "Not due yet"

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

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



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

3 REPLIES 3
BA_Pete
Super User
Super User

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



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Anonymous
Not 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.

shadysalman_0-1644920467259.png

 

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



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.