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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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