Forum Discussion

visheshjain's avatar
visheshjain
Icon for Impactful Individual rankImpactful Individual
3 years ago

Non-relationship values with +0

Hello everyone,

 

Does adding a +0 to a measure, break a relationship between 2 tables somehow?

 

So I have measure for complaints, and I have added +0 to it, in case there are no complaints, so that the measure does not give me a blank.

In doing so, I am getting unwanted rows in my matrix.
In both cases i.e w/ +0 and w/o +0 I have turned on the 'show items with no data' in order to level the playing field.

 

For e.g.

Department 'Bodyshop' has only 1 highlighted flow of relationship, which is correct. If I do not add a +0 in my measure the matrix is correct.


Now if I added a +0 to the measure, I get incorrect and unwated rows in the matrix. 

 

This is the flow of relationships between the Dim and Fact tables.

 

Is it a bug or something cause it has never happened before.
Would love to hear from the community!

 

Thank you,

Vishesh Jain

3 Replies

  • CNENFRNL's avatar
    CNENFRNL
    Icon for Community Champion rankCommunity Champion

    Not a bug at all. It's concerned about a built-in mechanism called "empty-rows removal".

    AutoExist and Normalization - SQLBI

     

    One thing to remember, all things are considered filters in DAX. By default, you can't see those "unreasonable" rows only because the measure result are empty; those rows do exist! When +0 forced empty rows to 0; those "unreasonable" rows show up.

     

    Solution to your issue is straightforward,

    • visheshjain's avatar
      visheshjain
      Icon for Impactful Individual rankImpactful Individual

      Hi CNENFRNL,

       

      So I tried this solution and it works!

       

      Just one thing, yes, the extra rows are not there anymore but, if the numerator and the denominator are both blank, then its still giving me a blank, even after adding the 0.

       

      I tried putting in 0 as the default value, in the DIVIDE() funtion, but it didn't work.

       

      Is there some way to fix this?

       

      Thank you,

      Vishesh Jain