cancel
Showing results for 
Search instead for 
Did you mean: 
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
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors