cancel
Showing results for
Did you mean:
Frequent Visitor

## COVID-19 US Tracking Sample - DAX Formula for Daily Death measure

Hi, I am practicing writing DAX formulas and come across the following measure from the "COVID-19 US Tracking Sample" file.

###### ) + 0
Everything makes perfect sense except the last "+ 0" part. Why was the + 0 required at the end of the measure, was it for providing an initial value for doing the SUM? Many thanks.
1 ACCEPTED SOLUTION
Super User

Hi, @MaggieWang , it's a common trick to convert BLANK() to 0, i.e. when this part of measure

``````__TodaysDeaths - CALCULATE(
SUM('COVID'[Deaths]) ,
FILTER(
COVID,
COVID[Date] = __Yesterday &&
COVID[County Name] = __CountyName &&
COVID[State] = __State
)
)``````

returns BLANK(), it can be converted to 0.

Try this measure to see the affect

``Test = BLANK() + 0``

 Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is beyond their comprehension! DAX is simple, but NOT EASY!
2 REPLIES 2
Anonymous
Not applicable
If you remove +0, you'll see immediately why it's there. And no, it's not necessary unless you want to see 0 instead of BLANK...
Super User

Hi, @MaggieWang , it's a common trick to convert BLANK() to 0, i.e. when this part of measure

``````__TodaysDeaths - CALCULATE(
SUM('COVID'[Deaths]) ,
FILTER(
COVID,
COVID[Date] = __Yesterday &&
COVID[County Name] = __CountyName &&
COVID[State] = __State
)
)``````

returns BLANK(), it can be converted to 0.

Try this measure to see the affect

``Test = BLANK() + 0``

 Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is beyond their comprehension! DAX is simple, but NOT EASY!

Announcements

#### 2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

#### Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

#### Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

#### Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.

Top Solution Authors
Top Kudoed Authors