Forum Discussion
PowerBINoob24
3 years agoResolver I
Creating an entry based upon a date compared to today
I have a status collumn that populates based upon a date column. It works great except for the highlighted portion. What I need to happen if the Approved Date field is blank and today is later than the Due Date field then I need the status approval field to show Overdue. Right now if the Approved Date is blank and today is later than the Due Date it still shows as In Process
Status Approval = IF(ISBLANK([Approved Date].[Date]), "In Process", IF(ISBLANK([Approved Date].[Date]) && (ISBLANK([Due Due].[Date]>TODAY()), "Overdue", IF([Approved Date].[Date]>[Due Date].[Date],"Late","On Time"))))
It would be helpful next time (or if this doesn't work) to include some sample data to work with.
The order matters with these statements, so try this instead.
Status Approval = SWITCH ( TRUE (), ISBLANK ('Execution Status'[Approved Date].[Date]) && ('Execution Status'[Due Date].[Date]) < TODAY (), "Overdue", ISBLANK ( 'Execution Status'[Approved Date].[Date] ), "In Process", 'Execution Status'[Approved Date].[Date] < 'Execution Status' [Due Date].[Date], "On Time", "Completed Late" )
8 Replies
- KNPSuper User
If I understand you correctly, maybe something like this...
Status Approval = SWITCH ( TRUE (), ISBLANK ( '[Approved Date].[Date]' ) && '[Due Due].[Date]' > TODAY (), "Overdue", '[Approved Date].[Date]' > '[Due Date].[Date]', "Late", ISBLANK ( '[Approved Date].[Date]' ), "In Process", "On Time" )- PowerBINoob24Resolver I
PowerBI doesn't like that
- KNPSuper User
Try removing the single quotes maybe?
- Ashish_MathurSuper User
Hi,
Try this calculated column formula
Status Approval = IF(ISBLANK([Approved Date]),IF(TODAY()>[Due date],"Overdue","In Process"),IF([Approved Date]>[Due Date],"Late","On Time"))
Hope this helps.