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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

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
AlB
Community Champion
Community Champion

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
Community Champion
Community Champion

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

 

 

AlB
Community Champion
Community Champion

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.