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
Anonymous
Not applicable

Two Unrelated Tables

Hi Guys,

I need help with below tables:

 

Objective: To calculate Inquiry/Qty from two different unrelated tables. Below are the tables. Entity is my Dummy company name, Qty is sales qty, Inquiry is # of issues we got. I am looking to calculate Inquiry/Qty.

 

Is there a way we can do this?

 

EntityQty
A2
B1
C4
D2
A5
G3
G1
E2
B4
D5
C

3

 

 

ENTITYINQUIRY
A1
B1
C1
D1
A1
G1
G1
E1
B1
D1
C1

 

Thanks

 

Rohit

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

@Anonymous 

I would recommend the solution suggested by @SteveCampbell , but if you don't want to create a Dimension Table, you could try:

 

Inquiry divided by Qty =
CALCULATE( DIVIDE(SUM(table2[ [Inquiry]), SUM(table1 [Qty])), TREATAS(VALUES(table1[Entity]), table2[Entity]))





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.






View solution in original post

6 REPLIES 6
PaulDBrown
Community Champion
Community Champion

@Anonymous 

I would recommend the solution suggested by @SteveCampbell , but if you don't want to create a Dimension Table, you could try:

 

Inquiry divided by Qty =
CALCULATE( DIVIDE(SUM(table2[ [Inquiry]), SUM(table1 [Qty])), TREATAS(VALUES(table1[Entity]), table2[Entity]))





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.






Thank you immensely! This worked like a charm for my case as well! 

SteveCampbell
Memorable Member
Memorable Member

Yes, builfd a dimension table that has all the uniqe list of company names.

I would advise to do this in Power Query if possible. Otherwise if one of the tables has all companies, you can use

VALUES(TABLE[Entity])

Then you can join this two your two fact tables

 

I would reccomend reading this, too:
https://docs.microsoft.com/en-us/power-bi/guidance/star-schema



Did I answer your question? Mark my post as a solution! Proud to be a Super User!


Connect with me!
Stay up to date on  
Read my blogs on  



Anonymous
Not applicable

Both of you are great! Thanks a ton.

@Anonymous 

As much as I appreciate you marking my suggestion (which in reality is only a "plan b" compared to building a dimension table) as a solution, I still strongly recommend you follow @SteveCampbell  suggestion. It will make life much easier!





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.






Anonymous
Not applicable

Surely i will follow @SteveCampbell suggestion and build dimension tables. Thanks!

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.