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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Erburi92
Frequent Visitor

Empty change to 0 in matrix

Hello,

 

I have some issues with data. In matrix I want to change blank with 0, however it failed. I tried many functions, but them do not work:

Erburi92_0-1662541231924.png

Total Number of outcomes with no blanks =
IF (
    CALCULATE (
        counta(Sheet[Index])
            = 0
    ),
    0,
    counta(Sheet[Index]

))
 
and 
Zero instead of blank =
var Value_Total = CALCULATE( COUNTA(Sheet[Index] ) )
return
IF( ISBLANK( Value_Total )
    , 0
    , Value_Total
)

 

When I change column to date, formula works:

Erburi92_1-1662541429023.png

 

Can someone help me? I add some example.

https://www.dropbox.com/s/ebs1vr0flhd7vjq/example.pbix?dl=0

 

Thank you:)

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,
Here is my workaround:
1. Create a separate table with distinct outcomes
2. Connect the tables on outcomes

3.Now use the "outcome" column from the new table for the visual
4. Change the dax for the measure as seen below.

PowerUserR_0-1662549458549.pngPowerUserR_1-1662549473876.pngPowerUserR_2-1662549495747.png

Change dax to this:
Zero instead of blank =
Count(Sheet[Outcome]) + 0

View solution in original post

4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

There @Erburi92 ,

It seems the shared file has been deleted... Could you please share it again?

yingyinr_0-1662629346628.png

And if your problem has been resolved, could you please mark the helpful post as Answered? It will help the others in the community find the solution easily if they face the same problem as yours. Thank you.

Best Regards

Anonymous
Not applicable

Hi,
Here is my workaround:
1. Create a separate table with distinct outcomes
2. Connect the tables on outcomes

3.Now use the "outcome" column from the new table for the visual
4. Change the dax for the measure as seen below.

PowerUserR_0-1662549458549.pngPowerUserR_1-1662549473876.pngPowerUserR_2-1662549495747.png

Change dax to this:
Zero instead of blank =
Count(Sheet[Outcome]) + 0
Erburi92
Frequent Visitor

I tried counta(Sheet[Index])+0, it does not work.

I do not need the matrix where the date is, I just show that with added dates formulas (I tried several different formulas) works, however, I need a matrix where the column is Reason and the row - Outcome (no date). With those columns (Reason and Outcome), no formula works when I need to change empty cells with 0.

amitchandak
Super User
Super User

@Erburi92 , Try like

counta(Sheet[Index])+0

 

it works better when you reason and month coming from another dimension

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors