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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
LinVen
Helper I
Helper I

Count Text Values, but return ) not (Blank) - Power BI

Hi Folks

I created a measure to count how many Overdue projects appear in a list

Overdue Count = CALCULATE( COUNTROWS( 'Project Overview'), 'Project Overview'[Overdue Flag] = "Overdue")

I created the Overdue flag in the source table first, so line by line there is either Overdue / Near Due or blank cells

Where a Project Manager has no Overdue projects, the Measure returns (Blank) (in my card visual)
LinVen_0-1678391205473.png


Does anyone have any tips for telling the measure to return Zero instead?



1 ACCEPTED SOLUTION
edhans
Super User
Super User

Wrap your function with COALESCE.

So COALESCE([Your Measure], 0)

COALESCE returns the first non-blank value, so if Your Measure is blank, it will default to the 0.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

2 REPLIES 2
LinVen
Helper I
Helper I

Perfect Solution

LinVen_0-1678437954827.png



Thank You!

edhans
Super User
Super User

Wrap your function with COALESCE.

So COALESCE([Your Measure], 0)

COALESCE returns the first non-blank value, so if Your Measure is blank, it will default to the 0.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors