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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
poko
Resolver I
Resolver I

filling empty cells with 0

Hello,

 

I would like to fill empty cell with zero, how can I do that? As you see on the picture, I have some empty cells...

This is my measure 

Total Pending =
CALCULATE(
    COUNTROWS('CecCaseDetail H'),
    'CecCaseDetail H'[Case] IN {"New", "Enhanced", "Stand" }
)poko_0-1733912719054.png

 

1 ACCEPTED SOLUTION
AnkitaaMishra
Super User
Super User

Hi @poko , 
Try below code : 
Total Pending =
COALESCE(
CALCULATE(
COUNTROWS('CecCaseDetail H'),
'CecCaseDetail H'[Case] IN {"New", "Enhanced", "Stand"}
),
0
)

Thanks, 
Ankita

View solution in original post

6 REPLIES 6
poko
Resolver I
Resolver I

And for this?

 

NewCasesPrecCount =
VAR SelectedYear = SELECTEDVALUE('Calendar'[Date].[Year])
RETURN
    CALCULATE(
        COUNT('CecCaseDetail'[CaseID]),
        'CecCaseEvent'[EventID] = 1,
        YEAR('CecCaseEvent'[EventDate]) = SelectedYear,
        'CecCaseEvent'[CecCaseId] = 'CecCaseEvent'[CecCaseId],
        FILTER(
            'CecLeadingCase',
            'CecLeadingCase'[CecCaseId] = 'CecLeadingCase'[CecCaseId]
        )
    )

Similarly @poko , you can use again COALESCE function : 

NewCasesPrecCount =
VAR SelectedYear = SELECTEDVALUE('Calendar'[Date].[Year])
RETURN
COALESCE(
    CALCULATE(
        COUNT('CecCaseDetail'[CaseID]),
        'CecCaseEvent'[EventID] = 1,
        YEAR('CecCaseEvent'[EventDate]) = SelectedYear,
        'CecCaseEvent'[CecCaseId] = 'CecCaseEvent'[CecCaseId],
        FILTER(
            'CecLeadingCase',
            'CecLeadingCase'[CecCaseId] = 'CecLeadingCase'[CecCaseId]
        )
    ),
0
)



just add COALESCE? Right?

yes it works 🙂

poko
Resolver I
Resolver I

It works Thank you.

AnkitaaMishra
Super User
Super User

Hi @poko , 
Try below code : 
Total Pending =
COALESCE(
CALCULATE(
COUNTROWS('CecCaseDetail H'),
'CecCaseDetail H'[Case] IN {"New", "Enhanced", "Stand"}
),
0
)

Thanks, 
Ankita

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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