Forum Discussion
Identify population based on a slicer
Sample Data Hi there,
I am looking to identify a population of workers based on a Manager selection in a slicer. The data includes a field called 'All Managers in Management Chain' and i want to identify all workers that include the selected Manager, featured in the Management Chain field. This will give me both the direct and indirect reports.
I think its a formula i need - possibly one of the 'Contains' DAX formula or 'Find Text'. Also found the code below but have been unable to get this to work. The formula will ideally flag each worker that has the selected Manager in the Management Chain field so all reports (direct & indirect) are captured.
Hoping you can help.....
Path Contains Tenant original =
VAR _SLICER =
SELECTEDVALUE ( 'Table2'[Customer Name] )
VAR _TENANT =
CALCULATETABLE (
VALUES ( 'Table1'[Parent Tenant] ),
FILTER ( ALL ( 'Table1' ), 'Table1'[Parent Tenant] = _SLICER )
)
VAR _RESULT =
IF (
MAX ( 'Table1'[Tenant Name] )
IN _TENANT
&& MAX ( 'Table1'[Parent Tenant] ) = _SLICER,
1
)
RETURN
_RESULT
7 Replies
- AnonymousNot applicable
Hi Anonymous ,
Please try:
Path Contains Manager = VAR _SLICER = SELECTEDVALUE ( 'Table2'[Manager Name] ) VAR _WORKERS = CALCULATETABLE ( VALUES ( 'Table1'[Worker Name] ), FILTER ( ALL ( 'Table1' ), CONTAINS('Table1'[All Managers in Management Chain], _SLICER) ) ) VAR _RESULT = IF ( MAX ( 'Table1'[Worker Name] ) IN _WORKERS, 1 ) RETURN _RESULTIf the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
If there was any way i can add a pbix file i would, but it doesnt give me the option.....please advise if there is a way.
- AnonymousNot applicable
Hi Anonymous ,
Refer to:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Think i have now managed to add sample data.....
- Ashish_Mathur
Super User
That leads to a sign-in page. Also, show the expected result.
- Ashish_Mathur
Super User
Hi,
Share some data and show the expected result.