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

Where to read about RELATED/relations? - problem example

Latest questions I made could be solved by me just understanding relations better in Power BI, I read solutions on forums but don't finish understanding the functions.

 

As an example, now I am doing multiple measures to calculate this, and I'm sure it can be done in one formula, don't know how, every thing I tryied gave wrong results.

Table_A [client, callCenter, contactDate]

Table_B [callCenter, employees]

 

I made a 1 to many relation, a Table B callCenter can have many calls (Table A) ON callCenter.

 

Want to get a rate of contacs/employees.

 

So the formula will be in the Table_A something like:

rate = DIVIDE(count(Table_A[client]),RELATED(Table_B[employees]))

obviously that doesnt work...still don't understand why.

 

The table I want to fill with this info has this fields, the functions are selected on the field properties in the table:
Table_A.call_center,count(Table_A.client),rate

 

The things I tryed with related make the value change if I added the callCenter of both tables or only of one of them, I don't want to add anything of Table_B.

 

I hope I make myself clear, english is not my primary languaje and I'm new to Power BI and this feels rather complex.

 

Thank you! 

1 ACCEPTED SOLUTION

@Anonymous,

 

You may add a measure as follows.

Measure =
DIVIDE (
    COUNT ( Table_A[client] ),
    MAXX ( Table_A, RELATED ( Table_B[employees] ) )
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
TomMartens
Super User
Super User

Hey @Anonymous,

 

in addition to trying the idea provided by @Ashish_Mathur you may find this book by Alberto Ferrari and Marco Russso interesting that delves deep into data modeling:
https://www.amazon.com/Analyzing-Power-Pivot-Business-Skills/dp/150930276X/ref=sr_1_3?ie=UTF8&qid=1536477301&sr=8-3&keywords=marco+russo

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

@TomMartens will look for it, thank you!

Ashish_Mathur
Super User
Super User

Hi,

 

Share some data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Table_A   Table_B 
clientcallCentercontactDatecallCenteremployees
6109/08/2018 110
6209/08/2018 22
6309/08/2018 5
5109/08/2018   
5109/08/2018   
6109/08/2018   
5209/08/2018   

 

Expected result table:

call_centercallsrate rate calculation
140,4(4/10)
221(2/2)
310,2(1/5)

 

Thank you!

Hi,

 

Try this

 

  1. Create a relatisnhip from the CallCentre column of Table_A to the CallCentre column of Table_B
  2. In your visual, drag the CallCentre column from Table_B
  3. Write these measures

Calls=COUNTROW(Table_A)

Rate=[Calls]/MIN(Table_B[Employees])

 

Forma the Rate measure as a %.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

On monday I'll have access to try it, and tell you how it went

I already done steps 1 and 2, step 3 sounds familiar, but I tryed too many things, will look into that, it feels strange that one cannot do that in one formula.

Thank you

@Anonymous,

 

You may add a measure as follows.

Measure =
DIVIDE (
    COUNT ( Table_A[client] ),
    MAXX ( Table_A, RELATED ( Table_B[employees] ) )
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.