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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Michael92
Frequent Visitor

Calculate today cases

Hello all,

 

I would like to count the number of cases for today and if there is an empty value, write zero.

I have already created these measures, but how to connect them together and create one measure?

 

Count_today = CALCULATE (DISTINCTCOUNT ( 'case'[id_case] ), 'case'[date] = TODAY ())
Count_zero_value = if(isblank(DISTINCTCOUNT(case[id_case])),0,DISTINCTCOUNT(case[id_case]))
 
Thank you
Michael
 
 
1 ACCEPTED SOLUTION

OK, now it works. Only a few parentheses needed to be added.

 

MyMeasure =
var Count_today = CALCULATE (DISTINCTCOUNT ( 'case'[id_case] ), 'case'[date] = TODAY ())


return
IF(
ISBLANK(Count_today),0,(Count_today)
)

 

Thank you 😊

View solution in original post

3 REPLIES 3
Migasuke
Memorable Member
Memorable Member

Hi @Michael92 ,

I don't think you need the second measure if I understand correctly.

Try following:

MyMeasure =
var Count_today = CALCULATE (DISTINCTCOUNT ( 'case'[id_case] ), 'case'[date] = TODAY ())

return
IF(
ISBLANK(Count_today,0,Count_today)
)



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

The syntax for 'returnif' is incorrect 🙄

Too many arguments were passed to the ISBLANK function. The maximum argument count for the function is 1.

OK, now it works. Only a few parentheses needed to be added.

 

MyMeasure =
var Count_today = CALCULATE (DISTINCTCOUNT ( 'case'[id_case] ), 'case'[date] = TODAY ())


return
IF(
ISBLANK(Count_today),0,(Count_today)
)

 

Thank you 😊

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.