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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

DAX Formula IF ISBLANK with LOOKUPVALUE

Hi,

The following lookupvalue formula works however the output is not quite right i.e. the lookupvalue is not including ALL blank cells, just some. Eg. if lookup cell is blank, return "Rest of Network" however I found numerous blank cells in the data that match the criteria but were NOT returning "Rest of Network", instead it was returning "" (blank). 

Am I missing something?

 

=IF('Flat File Data'[OnTime]="No" && ISBLANK(LOOKUPVALUE(DelayedScans[Delay Point],DelayedScans[Item_Id],'Flat File Data'[Item_Id])),"Rest of Network",IF('Flat File Data'[OnTime]="Yes","On-Time",LOOKUPVALUE(DelayedScans[Delay Point],DelayedScans[Item_Id],'Flat File Data'[Item_Id])))

 

 

 

 

 

1 ACCEPTED SOLUTION
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

Your code look okay, but try using BLANK().

 

Try this simplified code.

 

Column =
VAR _lookup =
    LOOKUPVALUE (
        DelayedScans[Delay Point],
        DelayedScans[Item_Id], 'Flat File Data'[Item_Id]
    )
RETURN
    SWITCH (
        TRUE (),
        'Flat File Data'[OnTime] = "No"
            && _lookup
                = BLANK (), "Rest of Network",
        'Flat File Data'[OnTime] = "Yes"
            || 'Flat File Data'[OnTime] = "On-Time", _lookup
    )

  

Also, hope the lookup value is returning a String.

 

A good video on Blank(), ISBLANK(), NULL and Empties.

https://www.youtube.com/watch?v=C26DQkb4hyY

 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

 

View solution in original post

3 REPLIES 3
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

Your code look okay, but try using BLANK().

 

Try this simplified code.

 

Column =
VAR _lookup =
    LOOKUPVALUE (
        DelayedScans[Delay Point],
        DelayedScans[Item_Id], 'Flat File Data'[Item_Id]
    )
RETURN
    SWITCH (
        TRUE (),
        'Flat File Data'[OnTime] = "No"
            && _lookup
                = BLANK (), "Rest of Network",
        'Flat File Data'[OnTime] = "Yes"
            || 'Flat File Data'[OnTime] = "On-Time", _lookup
    )

  

Also, hope the lookup value is returning a String.

 

A good video on Blank(), ISBLANK(), NULL and Empties.

https://www.youtube.com/watch?v=C26DQkb4hyY

 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

 

Anonymous
Not applicable

Thank you so much, that worked perfectly...just had to remove "||"

Appreciate the help.

 

sturlaws
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

 

you code looks ok, but without any sample data I can't help you understand why it does not work as intended.

 

Cheers,
Sturla

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Kudoed Authors