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
jsteffe
Helper III
Helper III

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

View solution in original post

VahidDM
Super User
Super User

@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
Super User
Super User

@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✌️!!

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

Merged table are a solution. Thanks

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.