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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Calculated Columns using nested IF and NOT(ISBLANK) returning text value

Hi,

I have two date columns and I am trying to create a calculated column depending on the combination of these two colums. Is there anyway to create them as a nested statement, that returns a text value, so that it can be used as a slicer with all the variable options?

ie IF Date1 &  Date 2 is value then "Complete" is returned. 
IF Date1 has a value & Date2 is blank then "Date2 missing" is returned etc.

 

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

Like this?

CalcCol =
SWITCH (
    TRUE (),
    ISBLANK ( Table1[Date1] ) && ISBLANK ( Table1[Date2] ), "Both dates missing",
    ISBLANK ( Table1[Date1] ), "Date1 missing",
    ISBLANK ( Table1[Date2] ), "Date2 missing",
    "Complete"
)

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thank you, I wasn't aware of SWITCH command. This has helped greatly.

AlexisOlson
Super User
Super User

Like this?

CalcCol =
SWITCH (
    TRUE (),
    ISBLANK ( Table1[Date1] ) && ISBLANK ( Table1[Date2] ), "Both dates missing",
    ISBLANK ( Table1[Date1] ), "Date1 missing",
    ISBLANK ( Table1[Date2] ), "Date2 missing",
    "Complete"
)
sevenhills
Super User
Super User

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.