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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
romovaro
Responsive Resident
Responsive Resident

show as 0 instead of Blank for formula

Hello

 

I need some help regarding this table. 

 

romovaro_0-1733135786410.png

 

 

I have Product Managers showing num of Projects by month. I have a target and I have the difference between Actual Projects and target by month. The problem I have is that if no Projects...then blank and the formula is not working. I would like to show zero so the table CALCULATES the negative number and shows they are available.

 

The formula I use for Num Projects with Index column.  (If same customer (CID) has same country and same Go Live Date from previous row is 0, otherwise 1)

 

 

NumProjects = IF (
    OR ( OR (
        'PV Cel File'[CID]<>
    CALCULATE (
        MAX ('PV Cel File'[CID]),
        FILTER (
            'PV Cel File',
            'PV Cel File'[Índice] = EARLIER ('PV Cel File'[Índice])-1)
    ),
    'PV Cel File'[Country Long Name]<>
    CALCULATE (
        MAX ('PV Cel File'[Country Long Name]),
        FILTER (
            'PV Cel File',
            'PV Cel File'[Índice] = EARLIER ('PV Cel File'[Índice])-1)
    )
    ),
        'PV Cel File'[GLD].[Date]<>
        CALCULATE(
            MAX('PV Cel File'[GLD].[Date]),
            FILTER(
                'PV Cel File',
            'PV Cel File'[Índice] = EARLIER ('PV Cel File'[Índice])-1)
        )
    )
    ,1
    ,0
    )

 

and then I have a Target by role table showing ROle, Date and Target.

 

romovaro_1-1733136634354.png

 

 

I have seen different formulas in the forum but none seems to work. I get the same results and same blanks.

 

1)

Actual-NumProjects = COALESCE( SUM ( 'PV Cel File'[NumProjects] ), 0)
 
2)
Actual-NumProjects =
IF (
CALCULATE ( SUM ('PV Cel File'[NumProjects] ) ) = BLANK (),
0,
CALCULATE ( SUM ( 'PV Cel File'[NumProjects]  ) )
)

 

3)
Actual-NumProjects = SUM('PV Cel File'[NumProjects])+0
 
4)
Actual-NumProjects = VAR Projects =
 SUM ( 'PV Cel File'[NumProjects])
RETURN
 IF (
 ISBLANK ( Projects ),
 0,
 Projects
 )
 
thanks
1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @romovaro 

Do these combinations of row and column values exist in your table? You can't assign a value to a row that doesnt exist.

danextian_0-1733138787743.png

A similar question was already raised in this post- https://community.fabric.microsoft.com/t5/Desktop/Matrix-showing-Blanks-and-Zeroes/m-p/4304795#M1349... 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

1 REPLY 1
danextian
Super User
Super User

Hi @romovaro 

Do these combinations of row and column values exist in your table? You can't assign a value to a row that doesnt exist.

danextian_0-1733138787743.png

A similar question was already raised in this post- https://community.fabric.microsoft.com/t5/Desktop/Matrix-showing-Blanks-and-Zeroes/m-p/4304795#M1349... 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.