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
Petecart77
Helper I
Helper I

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 7
Ashish_Mathur
Super User
Super User

Hi,

Share some data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-tangjie-msft
Community Support
Community Support

Hi @Petecart77 ,

 

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
    _RESULT

If 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. 

Think i have now managed to add sample data.....

That leads to a sign-in page.  Also, show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

out of ideas on adding sample data so unless you can provide some instructions on how i may be able to do this, not possible to proceed would you agree?

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.

Hi @Petecart77 ,

 

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. 

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.