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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
whenriques
Helper I
Helper I

Create Relationship to Add Field to Matrix Report

Any chance you can, please, help me create a relationship to add the '"Total Revenue" to the matrix report below:

 

whenriques_0-1651092134341.png

I have the relationship of the tables using "Period." See below 

 

whenriques_1-1651092232734.png

When I try to create a relationship between the tables "TopRankingQuery" and "Overrun Data" using the OrgName field, I get the error below that does not allow me to make the relationship active.

 

whenriques_2-1651092422533.png

 

 Any ideas or suggestions to fix this issue? The goal is to have the matrix report below with two columns (Overrun and Total Revenue). However, the Total Revenue column shows the same amount.

 

whenriques_3-1651092594187.png

Thank you for your time and effort. Much appreciated!!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @whenriques ,

 

Please check if this is what you want.

 

Total Overrun =
CALCULATE (
    SUM ( 'Overrun Data'[amount] ),
    USERELATIONSHIP ( TopRankingQuery[OrgName], 'Overrun Data'[Organization] ),
    FILTER ( 'Overrun Data', 'Overrun Data'[OFRmapping] IN { "overrun" } )
)

 

The basic logic is to create an inactive relationship and use USERELATIONSHIP() function to active the relationship while doing the calculation.

vjaywmsft_0-1651652772035.png

vjaywmsft_1-1651652797342.png

 

Best Regards,

Jay

 

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @whenriques ,

 

Both tables have an active relationship between date table so you can not create another active relationship between them.

You could create an inactive relationship(uncheck the 'make this relationship active').

Then create a measure like:

measure = calculate(sum([Total Revenue]),userelationship(TopRankingQuery[OrgName],Overrun Data[OrgName]))

https://docs.microsoft.com/en-us/dax/userelationship-function-dax 

 

Best Regards,

Jay

Hi Jay,

@Anonymous 

 

Thank you so much for taking a look. I believe you have the solution to my issue! Can you please take a look at the .pbix file below?

https://swcacorp-my.sharepoint.com/:u:/g/personal/whenriques_swca_com/ERxE1BKF0ZtKs6VSEZ_hsnsBEpkuhI3l5qjzRKdUqweR1A

 

Is it possible to add Direct Labor from one table and Total Overrun from a different table to a matrix report?

 

Both tables are related to the Date table based on Period. However, when I try to create a relationship between OrgName and Organization Name, Power BI cannot create this Many-Many relationship. Any thoughts or suggestions?

 

 

whenriques_4-1651596065640.png

 

 

How would you create an inactive relationship and then create the measure using userelationship?

 

Ultimately, I would like to have a matrix report with two columns (Direct Labor and Overrun) for period 202203. However, the values for Overrun as the same. See below:

 

whenriques_3-1651595835641.png

 

Any ideas from you would be greatly appreciated. I sincerely thank you for your time and support.

 

Cheers,

 

Willer

 

 

 

 

 

 

 

Anonymous
Not applicable

Hi @whenriques ,

 

Please check if this is what you want.

 

Total Overrun =
CALCULATE (
    SUM ( 'Overrun Data'[amount] ),
    USERELATIONSHIP ( TopRankingQuery[OrgName], 'Overrun Data'[Organization] ),
    FILTER ( 'Overrun Data', 'Overrun Data'[OFRmapping] IN { "overrun" } )
)

 

The basic logic is to create an inactive relationship and use USERELATIONSHIP() function to active the relationship while doing the calculation.

vjaywmsft_0-1651652772035.png

vjaywmsft_1-1651652797342.png

 

Best Regards,

Jay

 

Hi @Anonymous,

You are 'da man!!!! I have been trying to solve this question for almost a week by watching tons of videos, spending hours with this group, and working with my model for hours.... 🙂

 

Thank you so very much for your time and for helping me solve this Power BI question! I am grateful for your help and assistance and would love to buy you a cup of your favorite beverage in case you come to the Phoenix, AZ area!!

 

Cheers and thanks again,

 

Willer

whenriques
Helper I
Helper I

Below is a snapshot of the datasets: Any ideas?

 

whenriques_0-1651092976534.png

 

whenriques_1-1651093035765.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.