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
adavid999
Helper V
Helper V

don't calculate if ISBLANK

Hi what is the best way to use ISBLANK to cover two measures? I.e. I want to leave result of [2019 sales] - [2018 sales] blank, or I don't want to calculate, if either 2019 or 2018 is blank. At the moment it is only working on 2019.

 

=IF ( ISBLANK ( [2019 sales]) , BLANK() , [2019 sales] - [2018 sales])

 

Thanks,

A

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@adavid999 in case of both, try this

 

=IF ( ISBLANK ( [2019 sales]) || ISBLANK ( [2018 Sales] ), BLANK() , [2019 sales] - [2018 sales])

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

4 REPLIES 4
v-alq-msft
Community Support
Community Support

Hi, @adavid999 

 

Based on your description, I created data to reproduce your scenario.

Table:

c1.png

 

You may try the following measures.

2018Sales = SUM('Table'[2018 Sales])

2019Sales = SUM('Table'[2019 Sales])

Result1 = 
IF(
    OR(
        ISBLANK([2018Sales]),
        ISBLANK([2019Sales])
    ),
    BLANK(),
    [2019Sales]-[2018Sales]
)

Result2 = 
var tab = 
SUMMARIZE(
    'Table',
    'Table'[ID],
    'Table'[2018 Sales],
    'Table'[2019 Sales],
    "Result",
    IF(
        OR(
            ISBLANK('Table'[2018 Sales]),
            ISBLANK('Table'[2019 Sales])
        ),
        BLANK(),
        'Table'[2019 Sales]-'Table'[2018 Sales]
    )
)
return
SUMX(
    tab,
    [Result]
)

 

Result:

c2.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

aj1973
Community Champion
Community Champion

Hi 

It is because your IF is filtering only on 2019.

Use your expression into a SUMX function.

Regards

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

parry2k
Super User
Super User

@adavid999 in case of both, try this

 

=IF ( ISBLANK ( [2019 sales]) || ISBLANK ( [2018 Sales] ), BLANK() , [2019 sales] - [2018 sales])

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

This did the job, thank you.

A

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.

Top Solution Authors
Top Kudoed Authors