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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
WJ876400
Helper IV
Helper IV

IF statement

Hi

 

I have the below dates in a table, what i want to do is create the Review check column. If the Scheduled review is 30 days or less than the actual review I want to return Not Scheduled. If it is over 30 days after the actual review I want to return the scheduled review date.

Actual ReviewScheduled ReviewReview Check
01/09/201915/09/2019Not Scheduled
01/09/201930/10/201930/10/2019
01/09/201905/09/2019Not Scheduled
01/09/201901/11/201901/11/2019

 

thanks

1 ACCEPTED SOLUTION

So that means that the scheduled review column is of type text and not date. Is it the same for the actual review columns? IF so,

Review Check =
IF (
    Table1[scheduled review] = "To be scheduled",
    "Not scheduled",
    IF (
        DATEVALUE ( Table1[scheduled review] ) - DATEVALUE ( Table1[actual review] ) <= 30,
        "Not scheduled",
        Table1[scheduled review]
    )
)

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

 

View solution in original post

5 REPLIES 5
AlB
Super User
Super User

Hi @WJ876400 

 

Review Check =
IF (
    Table1[scheduled review] - Table1[actual review] <= 30,
    "Not scheduled",
    FORMAT ( Table1[scheduled review], "DD/MM/YYYY" )
)

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

 

Sorry @AlB  I missed that the table looks like this as there is not always a date in the scheculed column

 

Actual Review

Scheduled ReviewReview Check
01/09/201915/09/2019Not Scheduled
01/09/201930/10/201930/10/2019
01/09/201905/09/2019Not Scheduled
01/09/201901/11/201901/11/2019
01/09/2019To be scheduledNot Scheduled
01/09/2019To be scheduledNot Scheduled

 

 

So that means that the scheduled review column is of type text and not date. Is it the same for the actual review columns? IF so,

Review Check =
IF (
    Table1[scheduled review] = "To be scheduled",
    "Not scheduled",
    IF (
        DATEVALUE ( Table1[scheduled review] ) - DATEVALUE ( Table1[actual review] ) <= 30,
        "Not scheduled",
        Table1[scheduled review]
    )
)

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

 

Hi @AlB 

 

Sorry I haven't given you the full information - Scheduled review is TEXT and the actual review is Date.

 

The scheduled review date is from another measure that outputs the date or To be scheduled

 

thanks

Hi @AlB 

 

thanks for the quick response. I get the below error so it looks like I need to format the dates?

 

Capture.PNG

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.