cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jsteffe
Helper II
Helper II

Inactive relationship

Hello,

I get the model below :

relationships.png

 

As there is one relationship between country and customer, the relationship between country and employees is not active.

So how can I get a table with total of employees and total of customers per country ?

Thanks

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@jsteffe , country should join to order details.

 

Or do you need to have merged tables -  Customer+country

and Employee and Country

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

View solution in original post

VahidDM
Community Champion
Community Champion

@jsteffe 

 

In addition to @amitchandak reply, you can use USERELATIONSHIP code.

 

https://www.sqlbi.com/articles/using-userelationship-in-dax/

 

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

Appreciate your Kudos✌️!!

View solution in original post

4 REPLIES 4
VahidDM
Community Champion
Community Champion

@jsteffe 

 

In addition to @amitchandak reply, you can use USERELATIONSHIP code.

 

https://www.sqlbi.com/articles/using-userelationship-in-dax/

 

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

Appreciate your Kudos✌️!!

View solution in original post

I tried his formula and it works :

nb_employee_per_country = CALCULATE(count(Employee[EmployeeID]),USERELATIONSHIP(Countries[name],Employee[Country]))
 
Thanks
amitchandak
Super User
Super User

@jsteffe , country should join to order details.

 

Or do you need to have merged tables -  Customer+country

and Employee and Country

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

View solution in original post

Merged table are a solution. Thanks

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.