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

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

Reply
Anonymous
Not applicable

Comparing dates but handling results with no data in one column

Hi,

 

Probably a really bad title but couldn't quite figure out how to word it.

 

I am wanting to report on how many of our projects have achieved their target KPI of a go live date. So currently I have;

In KPI = IF([Servicecommencementdate] > [Targetgolivedate], "No", "Yes")

 

However some of the results in Servicecommencementdate have no data because the project has not gone live yet. Ideally I'd like the projects that have not yet gone live and have missed their target date to show "No", with "Yes" until that time happens but suspect that might not be possible.

 

If it isn't possible, how could I have it so the In KPI column is left blank for those projects that have yet to have anything added to the Servicecommencementdate column?

 

Thanks.

1 ACCEPTED SOLUTION
sturlaws
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

does this code give you your desired outcome:

In KPI =
SWITCH (
    TRUE (),
    ISBLANK ( [Servicecommencementdate] )
        && TODAY () <= [Targetgolivedate], "Yes",
    ISBLANK ( [Servicecommencementdate] )
        && TODAY () > [Targetgolivedate], "No",
    [Servicecommencementdate] > [Targetgolivedate], "No",
    [Servicecommencementdate] <= [Targetgolivedate], "Yes",
    "Other"
)

 

 

Cheers,
Sturla


If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

 

View solution in original post

3 REPLIES 3
sturlaws
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

does this code give you your desired outcome:

In KPI =
SWITCH (
    TRUE (),
    ISBLANK ( [Servicecommencementdate] )
        && TODAY () <= [Targetgolivedate], "Yes",
    ISBLANK ( [Servicecommencementdate] )
        && TODAY () > [Targetgolivedate], "No",
    [Servicecommencementdate] > [Targetgolivedate], "No",
    [Servicecommencementdate] <= [Targetgolivedate], "Yes",
    "Other"
)

 

 

Cheers,
Sturla


If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

 

Anonymous
Not applicable

Sturla thanks very much that is great. Out of interest what is the "other"?

 

Thanks.

The last statement of the switch-function is the ELSE-value, if none of the the other statements in the switch-statement evaluates to true, use this value. I prefer to use something else than blank, so I just randomly choose to use "Other". Having something else than blank sometimes makes it easier to troubleshoot.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.