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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Kyle_Wolfe_Ohio
Regular Visitor

Complex IF or ISBLANK

I have a pretty complex script & I am stuck on the final WHERE component. The following image is straight from the table that captures the "Date Filled" and "Date Vacated" information I need to use for some reports on our organization's positions. 

Kyle_Wolfe_Ohio_0-1714999327783.png

 

The first row indicates that the position was vacated and refilled = Filled

The second row indicates a brand new position that has never been filled or vacated = Vacant

The third and fourth rows indicate the position has only been occupied once and never vacated = Filled

 

I have compiled the following, but it is NOT showing the second row in the image above as vacant and I am not sure how to include it in the formula:

 

Is Vacant? =
VAR vToday =
    TODAY ()
VAR vResult =
    SWITCH (
        TRUE,
        NOT ISBLANK('Stale Pos PersNet PCR'[Date Vacated]), IF('Stale Pos PersNet PCR'[Date Vacated] >='Stale Pos PersNet PCR'[Date Filled], "Yes", "No"),
        ISBLANK ('Stale Pos PersNet PCR'[Date Vacated]), "No", "Yes"
)
RETURN
vResult
1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Kyle_Wolfe_Ohio Maybe: 

Is Vacant? =
VAR vToday =
    TODAY ()
VAR vResult =
    SWITCH (
        TRUE,
        [Date Filled] = BLANK() && [Date Vacated] = BLANK(), "Yes",
        [Date Vacated] <> BLANK() && [Date Vacated] >= [Date Filled], "Yes",
        "No"
    )
RETURN
vResult


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@Kyle_Wolfe_Ohio Maybe: 

Is Vacant? =
VAR vToday =
    TODAY ()
VAR vResult =
    SWITCH (
        TRUE,
        [Date Filled] = BLANK() && [Date Vacated] = BLANK(), "Yes",
        [Date Vacated] <> BLANK() && [Date Vacated] >= [Date Filled], "Yes",
        "No"
    )
RETURN
vResult


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

That worked! Thanks

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.