Forum Discussion

wbart's avatar
wbart
Icon for Helper I rankHelper I
5 years ago
Solved

filter by groups defined in tables

Hello,

I try to simply filter my data by several predifined groups. The data is stored in a table and every group is stored in a seperate table. I maybe missed it, but is there a simple way to select these groups as a filter with one click on and of in a report? 

  • Hi wbart 

     

    You need to define which item belongs to which group first in the table. Then you can create a relationship between the data table and group table on item columns. In this way you can use the group column in a slicer or filter or something else to filter the data table. The filter influence is passed by the relationship between tables. This is the easiest way.

     

    Reference: Model relationships in Power BI Desktop - Power BI | Microsoft Docs

     

    Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as the solution to help other members find it.

5 Replies

  • wbart ,The information you have provided is not making the problem clear to me. Can you please explain with an example.

    Appreciate your Kudos.

  • v-jingzhang's avatar
    v-jingzhang
    Icon for Community Support rankCommunity Support

    Hi wbart 

     

    You need to define which item belongs to which group first in the table. Then you can create a relationship between the data table and group table on item columns. In this way you can use the group column in a slicer or filter or something else to filter the data table. The filter influence is passed by the relationship between tables. This is the easiest way.

     

    Reference: Model relationships in Power BI Desktop - Power BI | Microsoft Docs

     

    Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as the solution to help other members find it.

    • wbart's avatar
      wbart
      Icon for Helper I rankHelper I

      Thanks v-jingzhang, in the case that the names belong to more than one group I run into trouble I think. Am I right?

      • v-jingzhang's avatar
        v-jingzhang
        Icon for Community Support rankCommunity Support

        Hi wbart 

        I'm not sure what's your data like. You could try modifying the relationship to having many-to-many cardinality with single (Group table filters Data table) direction. In my sample, it works. For example, if I define "name a" belongs to group1 and group2, “name a” will show when I select either group1 or group2 in a slicer.

        Regards,

        Jing