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
Gwhiz
Helper I
Helper I

Pulling values off an inactive relationship

I am trying to pull the value of a parent account number which has an inactive relationship to another table that contains all account numbers and a qty column.

 

The child account number has the active relationship to other tables but I can't find a formula to pull the value for the parent account number only.

 

Screenshot (3).png

 

Screenshot (5).png

 

The only formulas I can come up with are the following:

 

 

 
parent qty = 
calculate( 
SUM(addontable[qty]),
USERELATIONSHIP(Parrentaccounts[parrentaccountnumber],addontable[corpaccountnumber]))

 And it just returns the Qty of the child accounts, How can I pull the Qty of the parent account only?

 

 

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @Gwhiz 

I suggest you transform your data structure as below

Open Edit queries, in "Parentaccounts", select two columns and then select "unpivot columns"

7.png8.png

Then select "close&&apply", return to Data view, create relatinship as below.

9.png

Create a measure in "Parentaccounts",

Measure = SUM(addontable[qty])

10.png

 

Best Regards

Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for replying @v-juanli-msft however your method doesn't solve the main problem of getting the parent accounts Qty value to show only when the child account number is chosen.

 

The reason for this is to quickly compare the Qty from the Parent account to the child account in a big dataset. And each day 10-30 child accounts will be filtered for and having this formula will automate that comparison.

 

Is this even possible with DAX?

I think the only solution to this is to perform a join on the two tables

Gwhiz
Helper I
Helper I

Screenshot (6).pngScreenshot (7).png

 

Here are the other two tables

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.