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
PBI_newuser
Post Prodigy
Post Prodigy

How to combine 2 measures from different tables

Hi,

I wanna lookup the measure from Table A to Table B.

Table A:

I have calculate a measure Available Technician = DISTINCTCOUNT(Technician).

LineGroupTechnician
ABCABC-123Sam
ABCABC-123Lilly
ABCABC-234Billy
BCDBCD-123Cath
BCDBCD-234Edward

 

Table B:

In this table, I calculate Current Technician = DISTINCTCOUNT(Technician)

LineGroupTechnicianTotal hours
ABCABC-123Aaron12.5
ABCABC-234Ben4.5
BCDBCD-234Edward16.3
ABCBCD-234James3.2

 

I would like to combine these 2 information in one table as below:

LineABC BCD 
GroupABC-123ABC-234BCD-123BCD-234
Available Technician2111
Current Technician1102
7 REPLIES 7
parry2k
Super User
Super User

@PBI_newuser see attached, you can tweak it as you see fit.

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k ,

Actually I wish to calculate the Available technician = contribution of each technician for each product.

Please see the explanation below. Sample is here.

PBI_newuser_0-1612167153150.png

 

Hi @PBI_newuser ,


Since i cannot open the link of your newly shared file, I tested it on the original data model: created a calculated column to count the number of Line and Group respectively, and finally use the divide function to calculate the proportion of each technician:

C = 
VAR a =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER ( ALL ( 'Table' ), 'Table'[Line] = EARLIER ( 'Table'[Line] ) )
    )
VAR b =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER ( ALL ( 'Table' ), 'Table'[Group] = EARLIER ( 'Table'[Group] ) )
    )
RETURN
    DIVIDE ( b, a )

In the matrix table, replace the previous field with the calculated column created and put it in the value to get the following result:

v-henryk-mstf_2-1612255079490.jpeg


If it still does not solve your problem, please confirm whether the shared file link can be opened correctly, or change the sharing method. So that I can use the correct data for further testing. Looking forward to your reply.

 

Here is the sample pbix file.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-henryk-mstf , is the link working? 

Hi @v-henryk-mstf , it doesn't work. 

Please find the shared file URL here. 

parry2k
Super User
Super User

@PBI_newuser where you get from available vs current technician? It is not in the tables? what is the logic for it?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k  I created a measure "Current Technician"  in Table B and "Available Technician" in Table A.

Current Technician = DISTINCTCOUNT(Technician)

Available Technician = DISTINCTCOUNT(Technician)

 

I wanted to compare the count of technician with its associated Line & Group.

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.