Forum Discussion

LéaGr's avatar
LéaGr
Helper I
6 years ago
Solved

Including groups in normal slicer

Hi everybody,

 

I am asking for help on an issue I can't solve by myself (been trying for two days...) :')

I am trying to display groups in a slicer without using the Hierarchical slicer. 

 

I have a list of countries (Portugal, Italy, Germany, France) and I made groups, which create the following table :

   Country      ;        Group 1           ;     Group 2

Portugal    ;    Southern Europe  ;  International

Italy           ;    Southern Europe  ;  International

Germany   ;    Germany               ;  International

France       ;    France                   ;  National

 

The column Country is filtering a big table with all the data.

 

I would like to be able to create a classical segment filter (and not a hierarchy filter, if you wonder why it is because my client finds it ugly and wants to add a search option...) which displays all groups and countries together in a list like that :

National

International

Southern Europe

Germany

France

Portugal

Italy

 

I tried to create a new tab with this list but I was unable to find the right relationship to make it filter the way I want, I also tried to create a table with the groups and the summed data corresponding and merge it with the existing table but it was a hell of a work and my DAX is not strong enough...but I will be happy to learn!

 

If you can think of a solution that would be a great help!

Of course if you need any more information I will give it to you don't hesitate to ask,

 

Thank you very much!

 

Best,

Léa

 

  • Hi LéaGr,

     

    you can try a many-to-many relationship

    https://docs.microsoft.com/en-us/power-bi/desktop-many-to-many-relationships

                        n:1                                   n:m

    Fact-Table <--- Country Dim-Table <--- > Country Filter-Table

     

    Your filter table could look like this

    Country ;Filter ;SortID
    Portugal ;Portugal ;6
    Portugal ;Southern Europe ;3
    Portugal ;International ;2
    Italy ;Italy ;7
    Italy ;Southern Europe ;3
    Italy ;International ;2
    Germany ;Germany ;4
    Germany ;International ;2
    France ;France ;5
    France ;National ;1

     

2 Replies

  • mwegener's avatar
    mwegener
    Most Valuable Professional

    Hi LéaGr,

     

    you can try a many-to-many relationship

    https://docs.microsoft.com/en-us/power-bi/desktop-many-to-many-relationships

                        n:1                                   n:m

    Fact-Table <--- Country Dim-Table <--- > Country Filter-Table

     

    Your filter table could look like this

    Country ;Filter ;SortID
    Portugal ;Portugal ;6
    Portugal ;Southern Europe ;3
    Portugal ;International ;2
    Italy ;Italy ;7
    Italy ;Southern Europe ;3
    Italy ;International ;2
    Germany ;Germany ;4
    Germany ;International ;2
    France ;France ;5
    France ;National ;1

     

    • LéaGr's avatar
      LéaGr
      Helper I

      mwegener ,

       

      Thanks a lot for your help that worked perfectly. I created a new Filter Table as in your example and liked it to my Contry table.

       

      Have a good day,

       

      Léa