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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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