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! Learn more

Reply
adavid999
Helper V
Helper V

simple 0 if blank

Hello I am doing a simple % calculation and would like to replace blanks with zero when blank is returned.

 

The calculation is 

=[2020 total positive] / [total 2020] * 100

 

The [2020 total positive] value is based on this measure:

 

=CALCULATE(count(2020[resp]), (2020[resp] = 10))

 

Any help appreciated.

 

Many thanks,

 

A

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@adavid999 , try like

divide([2020 total positive] , [total 2020],0)

 

You do not need *100, you can mark it as % column in format session.

 

You can add +0, but that will create a left join. All data will be displayed

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@adavid999 , try like

divide([2020 total positive] , [total 2020],0)

 

You do not need *100, you can mark it as % column in format session.

 

You can add +0, but that will create a left join. All data will be displayed

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Pragati11
Super User
Super User

Hi @adavid999 ,

 

You can try modifying your calculation in 2 ways:

  1. IF( [2020 total positive] = BLANK(), 0, ([2020 total positive] / [total 2020]) * 100)
  2. Or try using DIVIDE function -->  DIVIDE([2020 total positive], [total 2020], 0) * 100

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

harshnathani
Community Champion
Community Champion

Hi @adavid999 ,

 

Create these measures

 

Measure =   DIVIDE ([2020 total positive] /( [total 2020] * 100))

 

COALSE  Measure = COALESCE([Measure],0)
 
 
 
Regards,
Harsh Nathani

thanks @harshnathani the coalesce function looks like it would work but i don't appear to have it in excel power pivot

Hi @adavid999 ,

 

Create a custom Column in Power Query

 

= if [2020 total positive] = null then 0 else [2020 total positive] / ([total 2020] * 100)

 

or 

 

if [2020 total positive] = blank then 0 else [2020 total positive] / ([total 2020] * 100)

 

Regards,
Harsh Nathani

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

 

 

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.

Top Solution Authors