cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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 November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.