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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors