Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello All,
I have 2 table, 1 Employee 2Relation between them.
This is how it looks like.
Relation
Employee
1-N relation between Employee and Relation. (EmployeeDetails:EmployeeID) with Relation (Employee-1).
I added a chart to check Developes hours.
But i want to filter employee based on the manager.
How to achive this ?
Thank you !
Solved! Go to Solution.
Hi @NithinBN
You can create the following measure
Measure =
VAR a =
CALCULATETABLE (
SUMMARIZE (
FILTER (
ALLSELECTED ( Relation ),
CONTAINSSTRING ( [Employee-1], "M-" ) && CONTAINSSTRING ( [Employee-2], "D-" )
),
[Employee-2]
),
CROSSFILTER ( 'Relation'[Employee-1], Employee[EmployeeID], NONE )
)
RETURN
CALCULATE (
SUM ( Employee[Hours] ),
FILTER ( Employee, [EmployeeID] IN a ),
CROSSFILTER ( 'Relation'[Employee-1], Employee[EmployeeID], NONE )
)
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @NithinBN
You can create the following measure
Measure =
VAR a =
CALCULATETABLE (
SUMMARIZE (
FILTER (
ALLSELECTED ( Relation ),
CONTAINSSTRING ( [Employee-1], "M-" ) && CONTAINSSTRING ( [Employee-2], "D-" )
),
[Employee-2]
),
CROSSFILTER ( 'Relation'[Employee-1], Employee[EmployeeID], NONE )
)
RETURN
CALCULATE (
SUM ( Employee[Hours] ),
FILTER ( Employee, [EmployeeID] IN a ),
CROSSFILTER ( 'Relation'[Employee-1], Employee[EmployeeID], NONE )
)
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Take a look at this article the describes how to create an employee hierarchy.
I think you will need to reorganize your Relation table a bit so you have each employee once and who their manger is. Then the article above describes how to build the chain of employees from the bottom to the top.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 50 | |
| 44 | |
| 41 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 69 | |
| 68 | |
| 32 | |
| 32 | |
| 32 |