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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ronaldbalza2023
Continued Contributor
Continued Contributor

Replacing NIL values in rows with zero - matrix table

Hi everyone, how can I replace the rows in Matrix Table having blank/nil values with zero - which is currently greyed out? The + 0 old trick doesn't seem to work. Thanks in advance 🙂

ronaldbalza2023_0-1633671217447.png

Here are the measures.

 

P&L New = 
(
    CALCULATE (
        SUM ( 'Invoices'[Line Amount FX Calculation] ),
        FILTER (
            'Accounts',
            Accounts[Class] = "Revenue"
                || Accounts[Class] = "Expense"
        ), USERELATIONSHIP( Invoices[Invoice Line ID], 'Tracking Category CONNECTIONS'[ID])
    )
) - [P&L - Credit Notes] + [P&L (Journals) New]

 

P&L - Credit Notes = 
CALCULATE (
    SUM ( 'Credit Notes'[Line Amount Credit Note Calculation FX] ),
    FILTER (
        'Accounts',
        'Accounts'[Class] = "Revenue"
            || Accounts[Class] = "Expense"
    ), USERELATIONSHIP( 'Credit Notes'[Credit Note Line ID], 'Tracking Category CONNECTIONS'[ID])
)
P&L (Journals) New = 
CALCULATE ( -1* ( SUM ( 'Journals'[Net Amount FX] ) ),
    FILTER ( 'Journals', 'Journals'[Split] = "JOURNALS" ),
    FILTER (
        'Accounts',
        'Accounts'[Class] = "Revenue"
            || Accounts[Class] = "Expense"
    ), USERELATIONSHIP( Journals[ID], 'Tracking Category CONNECTIONS'[ID])
) 

 

1 ACCEPTED SOLUTION

@ronaldbalza2023, this will be my last post on this topic - I promise!

 

Go into Power Query, select the relevant columns that have null. Replace null with 0. Close and apply. It should fix the blank problem and you won't need to modify your measures.

 

If it doesn't work, best of luck with it all mate.

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

4 REPLIES 4
PaulDBrown
Community Champion
Community Champion

Try adding + 0 at the end of the measures. As in:

0 for blank = [your measure] + 0

 

(obviously you can just add the "+ 0" expression to the actual measures; no need to create new ones)





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






TheoC
Super User
Super User

@ronaldbalza2023, did you try the following?

 

Measure = IF(ISBLANK([P&L]),BLANK(),IF(ISBLANK([P&L]),0,[P&L]))

 

The issue that may be causing the blank is that there may be blanks in your outputs that are valid blanks and therefore this measure will test to see if a blank exists, if it does, it will convert the blank to 0, otherwise deliver the output of the measure.  

 

Hope this helps

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Hi @TheoC it works that the blank were replaced by zero. HOWEVER, there's this column appears with zero values in it and won't that to happen as can be seen on the snapshot below. Thanks very much for your time, really appreciated it.

ronaldbalza2023_0-1633699549715.png

 

@ronaldbalza2023, this will be my last post on this topic - I promise!

 

Go into Power Query, select the relevant columns that have null. Replace null with 0. Close and apply. It should fix the blank problem and you won't need to modify your measures.

 

If it doesn't work, best of luck with it all mate.

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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