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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
alapointe
Frequent Visitor

Measure + 0 is adding relationship who doesn't exist between objects

Hi,

 

I have 3 tables, Parents, Childs, and Incomes.

They are all 1 to many.

 

My measure :

SumChildMeasure = SUM(Incomes[Value]) + 0

Now if I show a table with 3 columns, ParentName, ChildName, SumChildMeasure.

I will have combinations of Parent and Child who don't exist.

If I remove the "+ 0", I won't have the Child who doesn't have any incomes.

 

Exemple :

ParentName/ChildName/SumChildMeasure

ParentAParentAChildA50
ParentAParentAChildB1110
ParentAParentAChildC1110
ParentAParentBChildA0
ParentAParentBChildB0
ParentAParentCChildA0
ParentBParentAChildA0
ParentBParentAChildB0
ParentBParentAChildC0
ParentBParentBChildA100
ParentBParentBChildB2220
ParentBParentCChildA0
ParentCParentAChildA0
ParentCParentAChildB0
ParentCParentAChildC0
ParentCParentBChildA0
ParentCParentBChildB0
ParentCParentCChildA0

 

The ParentCChildA doesn't have any incomes, but the relation between the ParentC and ParentCChildA exist, so I want to show 0.

 

Put there is know link between ParentA and ParentBChildA, so I don't want to show 0.

 

Any clues on how to fix this?

Thanks

 

1 ACCEPTED SOLUTION

I solve my problem using columns at each level, calculating the sum but it less flexible with filters. Mergin rows can't work if you have to many rows, it's also duplicating values.

 

Thanks for your help

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

The measure without the +0 returns a blank - which is automatically filtered out of Power BI reports. But when you add 0 to it, the blanks all becomes zeros - which are NOT automatically filtered out of reports...so you'll see rows show up for every combinations of dimension values.

 

You didn't really specify what the input data tables look like, but I'm imagining:

A "parent" table that has a parent key and parent name

A "child" table that has the child key, child name and a parent key

An "income" table that has child key and income amounts - presumably there are no rows for children who have zero income (because I think they would have shown up if those existed)

 

If this is the case, then in Power Query you can "merge" rows into the income table that contain each unique child from the child table along with an income amount of 0 (NOT blank). Then I think you measure will show all children and their relationships to parents, without having to use the +0 in your measure (which hoses everythign  up)

 

Hope this helps!

Scott

 

I solve my problem using columns at each level, calculating the sum but it less flexible with filters. Mergin rows can't work if you have to many rows, it's also duplicating values.

 

Thanks for your help

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors