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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
romovaro
Responsive Resident
Responsive Resident

Replacing Blanks with Zeros in a Matrix - Date filter no data

HI

 

I have seen different solutions to this issue in the forum but it seems none is working for me.

 

I ahve a table showing the number of projects going Live x month and the Productivity owner name

 

romovaro_1-1737536331086.png

 

Num of projects = All projects with Same customer, same country and same Go Live date = 1 project

The formula below and using the Index column checks previous row for this requierements and shows 0 until condition is met, then 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]<>
        CALCULATE(
            MAX('PV Cel File'[GLD]),
            FILTER(
                'PV Cel File',
            'PV Cel File'[Índice] = EARLIER ('PV Cel File'[Índice])-1)
        )
    )
    ,1
    ,0
    )

 

I can have different projects rows but if same country/Same Date and same customer...al rows will show 0 except one row that will show 1.

romovaro_2-1737536861750.png

 

 

I would like to show 0 when no projects are scheduled in that month instead of blank so my Target and diff formula works.

Any tip?

 

thanks

4 REPLIES 4
Uzi2019
Super User
Super User

Hi @romovaro 

 

You can simply add 0 to your measure or create one measure with +0 at the end.

 

measure= calculate----------

return result +0

 

I hope this might solve your issue!

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
romovaro
Responsive Resident
Responsive Resident

HI @Uzi2019 

 

I also treid this one but nothing:

 

Measure = calculate(SUM('PV Cel File'[NumProjects]))+0
 
I keep getting blanks
 
My Measure = Old formuola for Projects
 
romovaro_0-1737547408748.png

 

bhanu_gautam
Super User
Super User

@romovaro Yoyu can use the IF function to check for blanks and replace them with zeros

 

DAX
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] <>
CALCULATE (
MAX ('PV Cel File'[GLD]),
FILTER (
'PV Cel File',
'PV Cel File'[Índice] = EARLIER ('PV Cel File'[Índice])-1
)
)
),
1,
0
)

 

you can wrap your NumProjects measure in another IF statement to check for blanks and replace them with zeros:

DAX
NumProjectsWithZero =
IF (
ISBLANK([NumProjects]),
0,
[NumProjects]
)




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

Proud to be a Super User!




LinkedIn






HI @bhanu_gautam 

 

Thanks for your quick response.

Unfortunately I get the same results and blanks.

 

romovaro_0-1737539064941.png

 

SumProjectsWithZero =
IF (
ISBLANK(SUM('PV Cel File'[NumProjects])),0,SUM('PV Cel File'[NumProjects]))
 
the issue in my case is that blanks are "Non existent". I filter by date and if blank, that means that the table has no data for this month/Product manager...
 
Eerything comes from one table except the target that is located in another table.
 
romovaro_1-1737539329258.png

 

In Excel would be similar to this:

 

romovaro_2-1737539733421.png

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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