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
duncip
Frequent Visitor

Measure behaving strange - returning 0 for some fields and blanks for others

Hey,

 

For the tables in our dashboards we try and show 0s instead of blanks so it looks neater and it's not hiding any columns. Most of the time, this works easily enough by using the +0 functionality in a measure. However, I've now created a measure (it's based on a SQL view) and it seems to be doing it correctly for some of the columns/rows but not others:

duncip_0-1722849239318.png

You can see in the second row, first column it just returns a blank and I'm not sure why? I've tried doing the measure in 2 different ways and both are resulting in the same:

 

 

All Jobs = 
    VAR _MeasureCalc = CALCULATE(
        DISTINCTCOUNT(vw_table[ORDER_NUMBER]),
        FILTER(
            vw_table,
            vw_table[Status_Categorisation] = "New"
    )
    ) +0
    
    RETURN
    IF(NOT(ISBLANK(_MeasureCalc)),_MeasureCalc, 0)

 

 

 

and the more standard one we use:

 

 

All Jobs Test = 
    CALCULATE(
        DISTINCTCOUNT(vw_table[ORDER_NUMBER]),
        FILTER(
            vw_table,
            vw_table[Status_Categorisation] = "Dispatched" &&
            vw_table[Priority_Categorisation] <> "No-Category" &&
            not(isblank(vw_table[Priority_Categorisation]))
    )
    ) +0

 

 

 

Has anyone come across this before? Thanks!

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@duncip , Try updating your measure using COALESCE

All Jobs =
VAR _MeasureCalc =
    CALCULATE(
        DISTINCTCOUNT(vw_table[ORDER_NUMBER]),
        FILTER(
            vw_table,
            vw_table[Status_Categorisation] = "New"
        )
    )
RETURN
COALESCE(_MeasureCalc, 0)
 
And
All Jobs Test =
VAR _MeasureCalc =
    CALCULATE(
        DISTINCTCOUNT(vw_table[ORDER_NUMBER]),
        FILTER(
            vw_table,
            vw_table[Status_Categorisation] = "Dispatched" &&
            vw_table[Priority_Categorisation] <> "No-Category" &&
            NOT(ISBLANK(vw_table[Priority_Categorisation]))
        )
    )
RETURN
COALESCE(_MeasureCalc, 0)



Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

3 REPLIES 3
ThxAlot
Super User
Super User

Based on your description, it's inferred the column and row of matrix are both from vw_table; thus no need to waste time seeking method to make any value appear in cell (IOW, P1). Power BI alreay implemented an intelligent mechanism call "Auto-Exist". Google this term by yourselft; there are tons of references out there.

 

Btw, from syntax piont of view, simplify your measure,

All Jobs Test =
CALCULATE(
    DISTINCTCOUNT( vw_table[ORDER_NUMBER] ),
    vw_table[Status_Categorisation] = "Dispatched",
    vw_table[Priority_Categorisation] <> "No-Category",
    NOT ( ISBLANK( vw_table[Priority_Categorisation] ) )
) + 0

 



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



bhanu_gautam
Super User
Super User

@duncip , Try updating your measure using COALESCE

All Jobs =
VAR _MeasureCalc =
    CALCULATE(
        DISTINCTCOUNT(vw_table[ORDER_NUMBER]),
        FILTER(
            vw_table,
            vw_table[Status_Categorisation] = "New"
        )
    )
RETURN
COALESCE(_MeasureCalc, 0)
 
And
All Jobs Test =
VAR _MeasureCalc =
    CALCULATE(
        DISTINCTCOUNT(vw_table[ORDER_NUMBER]),
        FILTER(
            vw_table,
            vw_table[Status_Categorisation] = "Dispatched" &&
            vw_table[Priority_Categorisation] <> "No-Category" &&
            NOT(ISBLANK(vw_table[Priority_Categorisation]))
        )
    )
RETURN
COALESCE(_MeasureCalc, 0)



Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Dangar332
Super User
Super User

Hi, @duncip 

In your all jobs Measure elemenate IF() part just simply use +0 after your calculation.
like below

All Jobs = 
CALCULATE(
        DISTINCTCOUNT(vw_table[ORDER_NUMBER]),
        FILTER(
            vw_table,
            vw_table[Status_Categorisation] = "New"
    )
    ) +0
    
   

 

Best regards,
Dangar 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

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