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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Coalesce replace Blank

For showing the count which replaces the Blank to 0 at the cart, I have been using the following dax query:

 

Cases =
var caseCount = DISTINCTCOUNT(DD_FLU_DEMOGRAPHIC[Case ID])
return
IF(ISBLANK(caseCount), 0, caseCount)

 

But the problem is it rounds up the count. For example, it shows 38560 as 40K.
Would you please suggest any alternative?
I tried with coalesce function but it does not work for the string type data (for example, Case ID )

Regards

 
2 REPLIES 2
Anonymous
Not applicable

Hello @Anonymous 
You can try this code.
Cases = DISTINCTCOUNT(DD_FLU_DEMOGRAPHIC[Case ID]) + 0

AlexisOlson
Super User
Super User

Both possible branches of IF need to return the same data type. In your case, they're both numeric. Fortunately, you can set the format for a measure if you don't like what it automatically chose for you.

 

If you had a string Case ID instead of a numerical count, then you'd need to use a string as the other option in the IF. For example, you could use "0" instead of 0.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.