Forum Discussion

Singularity9's avatar
Singularity9
Icon for Helper I rankHelper I
1 year ago
Solved

How to apply a measure filter based on path checking to a map visual

I have a map which feeds off TableA, using latitude and longitude. I want to filter the map so it only returns values where the data was entered by a subordinate of the manager who is using the page,...
  • v-dineshya's avatar
    1 year ago

    Hi Singularity9 ,

    Thank you for reaching out to the Microsoft Community Forum.

     

    Please follow below steps.

    1. Created two tables (Employee, Table) with sample data, please refer below snap.

     

    2.  Created "Supervisor_Path" column in Employee table  with below DAX.

     

    Supervisor_Path = PATH('Employee'[Emp No], 'Employee'[Supervisor Search])

     

    3. Created  "Is_Subordinate_Measure" measure that checks whether a row is from a subordinate 

     

    Is_Subordinate_Measure =
    VAR CurrentUserEmpNo =
        LOOKUPVALUE(
            'Employee'[Emp No],
            'Employee'[Email Address],
            USERPRINCIPALNAME()
        )
    VAR RowEmpNo =
        SELECTEDVALUE('Table'[Emp No])
    VAR PathToCheck =
        LOOKUPVALUE(
            'Employee'[Supervisor_Path],
            'Employee'[Emp No],
            RowEmpNo
        )
    RETURN
        IF (
            PATHCONTAINS(PathToCheck, CurrentUserEmpNo),
            1,
            0
        )

    4. Selected "Azure Map"  and dragged below fields.
     
    Table[Latitude] as Latitude & Table[Longitude] as Longitude. Add the "Is_Subordinate_Measure" to Filters on this visual. Set the filter to "1".
     
    For testing, Please check below things.
     
    5. Selected "Table" visual , and draged the required columns from "Employee" table.
    6. In modeling tab -> View as -> and mentioned email address for testing.
    7. Please refer the output snap and attched PBIX file.

     

    If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.

    Thank you