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
vanhell54321
Frequent Visitor

Need help with relationships

Requirement 

 

Creating a report which shows Individual contribution vs Team in % . The team works on tickets. Need to implement RLS.Need to use slicers for Date(Year and month)

Duplicated the ticket table(removed the employee column) as the table was getting impacted when using RLS.

It may sound simple but facing some issues when an employee is selected from the slicer the total count of the team is also changing which should not happen. This might be happening because of the date table relationship.
Not sure how to avoid this .


Capture123456.PNG

Requesting for inputs.


Thanks!

 

 

2 ACCEPTED SOLUTIONS
d_gosbell
Super User
Super User


@vanhell54321 wrote:


It may sound simple but facing some issues when an employee is selected from the slicer the total count of the team is also changing which should not happen. This might be happening because of the date table relationship.

 


It's hard to say without seeing the filtering settings for your relationships, but if your relationships on the date table are setup to do bi-directional filtering it could cause behaviour like this. What it would do would be to filter the second tickets table down to only dates that existed for a given employee in the first tickets table. Which is probably not what you want.

 

If this is the case the fix would be to turn off bi-directional filtering and just have single direction filtering from Date to the 2 Tickets tables. (a good practice is to set all relationships to single direction filters by default unless you specifically know you need a bi-directional filter and understand the consequences) 

View solution in original post

v-xuding-msft
Community Support
Community Support

Hi @vanhell54321 , 

By my test, you can create a irrelative table as a slicer to filter the table of Individual contribution. The following is my sample you can have a try.

Measure = 
var a = SELECTEDVALUE(EMPLOYEE[EMPLOYEE])
var b = CALCULATE(COUNT(Individual[Tickets]),ALL(Individual[employee]),FILTER(Individual,Individual[employee] = a))
return 
SWITCH(TRUE(),ISFILTERED(EMPLOYEE[EMPLOYEE]),b,SUM(Individual[Tickets]))

1.PNG2.PNG3.PNG4.PNG

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
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

2 REPLIES 2
v-xuding-msft
Community Support
Community Support

Hi @vanhell54321 , 

By my test, you can create a irrelative table as a slicer to filter the table of Individual contribution. The following is my sample you can have a try.

Measure = 
var a = SELECTEDVALUE(EMPLOYEE[EMPLOYEE])
var b = CALCULATE(COUNT(Individual[Tickets]),ALL(Individual[employee]),FILTER(Individual,Individual[employee] = a))
return 
SWITCH(TRUE(),ISFILTERED(EMPLOYEE[EMPLOYEE]),b,SUM(Individual[Tickets]))

1.PNG2.PNG3.PNG4.PNG

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
d_gosbell
Super User
Super User


@vanhell54321 wrote:


It may sound simple but facing some issues when an employee is selected from the slicer the total count of the team is also changing which should not happen. This might be happening because of the date table relationship.

 


It's hard to say without seeing the filtering settings for your relationships, but if your relationships on the date table are setup to do bi-directional filtering it could cause behaviour like this. What it would do would be to filter the second tickets table down to only dates that existed for a given employee in the first tickets table. Which is probably not what you want.

 

If this is the case the fix would be to turn off bi-directional filtering and just have single direction filtering from Date to the 2 Tickets tables. (a good practice is to set all relationships to single direction filters by default unless you specifically know you need a bi-directional filter and understand the consequences) 

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.