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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
Continued Contributor
Continued Contributor

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]
        )
    )
AnkitaaMishra
Continued Contributor
Continued Contributor

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
Continued Contributor
Continued Contributor

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
ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.