Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

Top Solution Authors