Forum Discussion

duggy's avatar
duggy
Icon for Advocate II rankAdvocate II
8 years ago

Re: Relationship filtering on many to one doesnt filter

Thank you for the file, am busy looking through it and trying to implement.

Just to clarify, this is the solutoin that when I select a user in the multiple table (multiplesites) then the single table (sites) will only show the sites that the user is assigned to (from the multiplesites table that has the userid and the siteid).

 

When I do this graphically in powerbi charts they seem to respond correctly (select the user, the list of the sites the user is assigned to is displayed and the totals for the sites is displayed).

 

I am however passing the userid through Managed Roles. So that when the graphs are embedded the logged in user can only see his data for his sites.

 

We still ont he same page and your solution will correct for this?

 

Much appreciated.

10 Replies

  • duggy's avatar
    duggy
    Icon for Advocate II rankAdvocate II

    I am not sure that this is what I am looking for, or possibly I am not understanding it.

    The simple issue that I am having is when I select the user in Manage Roles for the mutiplesite, I see the filer of data for all the sites the user is associated with.

     

    So if user 123 is associated with sites 9, 10, 11 then the multiplesites table looks like:

     

    UseridSiteId
    1239
    12310
    12311

     

    I expect that when the managed roles user of 123 is selected then this is the result (this is indeed happening in the multiplesites table)

    However in the sites table, the filter is not carrying through. I have a sites table with:

     

    SiteIdName
    9Site 1
    10Site 2
    11Site 3
    12Site 4
    13Site 5
    14Site 6

     

    The goal is that when the multiplesites is filtered through managed role userid 123 then the sites table would filter the data to:

    SiteIdName
    9Site 1
    10Site 2
    11Site 3

     

    At the moment the sites table is not responding at all.

     

    Much appreciated.

     

    • Seward12533's avatar
      Seward12533
      Icon for Solution Sage rankSolution Sage

      It’s the filter context. The relationship is from Sites -> DailyEntrance is sites is NOT normally filtered by daily entrance.

      If the measure your displaying is [measure] try
      NewMeasue = CALCULATE([measure],sites)

      This will force that relationship to be applied.  

      If it’s not working you may need to force a relationship with a different or additional tabales, or you coudl build and share a sample PBIX file.

      See this updated example with a more complex relationship that more closely mirrors yours. https://1drv.ms/u/s!AuCIkLeqFmlhhJgzLZ6jPcWgLGu3Yw

      • duggy's avatar
        duggy
        Icon for Advocate II rankAdvocate II

        Hi,

         

        Thank you for the response. I am not sure I follow you. Sites to dailyentrance filtering is working. When I filter sites then the dailyentrance is filtering correctly.

         

        Multiplesites to sites is not filtering correctly. When I Manage Roles to multiplesites by user (then the siteid remains for the given user) then Sites is not filtering.

         

        Does this mean that I need to add something like (INTO SITES):

        NewMeasue = CALCULATE(sites[siteid],multiplesites[siteid]) ?

        in order to filter sites by the filtered siteid in multiplesites?

         

      • duggy's avatar
        duggy
        Icon for Advocate II rankAdvocate II

        ok, I see the issue you have. Change the data to as follows (and you will see the issue that I am having):

        on table multiplesites change the user 124 to have siteid 9 and 10. Meaning that user 123 is assigned to site 9, 10 and 11 and user 124 is also assigned to 2 of the 3 sites user 123 is assigned to (a subset of the same sites) - sites 9 and 10.

         

        Then you will have the same issues that I am having which I need to try solve for.

         

        This means that userA can be assigned to site 1,2 and 3 and userB can also be assigned to sites 1,2 and 3. At the moment if they are all assigned to different sites it will work, but if they are assigned to same sites or subset of sites it doesnt filter through.