cancel
Showing results for
Did you mean:
Highlighted
Post Prodigy

## Show blank cells as zeros using Sum formula in dax

Hi Experts

how would you convert the following sum formula to show '0' in empty/blank cells as opposed to blank...

OHASum = SUM(OHA_[Total])

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User II

## Re: Show blank cells as zeros using Sum formula in dax

well normally blanks wouldn't appear at all unless there is value in other measures
so maybe a conditional such us this would solve it:

`OHASum =VAR OHA = SUM ( OHA_[Total] )RETURN IF ( ISBLANK ( OHA ) && ( [OtherMeasure1] <> 0 || [OtherMeasure2] <> 0 ), 0, OHA )`

Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Proud to be a Super User!

7 REPLIES 7
Highlighted
Frequent Visitor

## Re: Show blank cells as zeros using Sum formula in dax

Could you try OHASum = IF(HASONEVALUE(SUM(OHA_[Total]));0)?

Highlighted
Post Prodigy

## Re: Show blank cells as zeros using Sum formula in dax

getting the following error

Highlighted
Frequent Visitor

## Re: Show blank cells as zeros using Sum formula in dax

My bad, the if-formula is not complete.

OHASum = IF(HASONEVALUE(SUM(OHA_[Total]);SUM(OHA_[Total]);0)

Highlighted
Super User II

## Re: Show blank cells as zeros using Sum formula in dax

this will work

`OHASum = SUM(OHA_[Total])+0`

the issue may be that you will see more items that you would normally like

Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Proud to be a Super User!

Highlighted
Post Prodigy

## Re: Show blank cells as zeros using Sum formula in dax

Hi Stachu

Apologies but no working that data set in the table increase to show unwanted elements.....still not getting the desireed result

Highlighted
Post Prodigy

## Re: Show blank cells as zeros using Sum formula in dax

i have chnaged the ; to , and still getting error to many values passed to the HASONEVALUE function

Highlighted
Super User II

## Re: Show blank cells as zeros using Sum formula in dax

well normally blanks wouldn't appear at all unless there is value in other measures
so maybe a conditional such us this would solve it:

`OHASum =VAR OHA = SUM ( OHA_[Total] )RETURN IF ( ISBLANK ( OHA ) && ( [OtherMeasure1] <> 0 || [OtherMeasure2] <> 0 ), 0, OHA )`

Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Proud to be a Super User!

Announcements

#### Power Platform Community Conference

Check out the on demand sessions that are available now!

#### Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

#### Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

#### Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors