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
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
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.