Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Create one filter based on two columns conditions

Hello,

 

I am posting a message here because I have a problem that I cannot resolve.

 

I want to view the data of my stores. There are different indicators ("co_indic" column, and "valeur" column). These indicators are calculated by store section ("rayon" column).

 

I would like to create a segment on this column to display only the selected section. However I also want to display "all sections of the store".

The "Tous rayons" column allows you to say whether this row corresponds to all the sections. (1 else 0).

This column is necessary because it may happen that a store has only one section. So when we want to analyze the values ​​of the indicators for a store as a whole, these lines must appear.

 

My data :

 

Point de Ventecode_IndicateurValeurRayonTous rayons
ParisACT589600,8Femme0
ParisACT589600,5Homme0
ParisACT589600,75Enfant0
ParisACT589600,7tous rayons1
LilleACT589600,85Femme0
LilleACT589600,68Homme0
LilleACT589600,2Linge de maison0
LilleACT589600,6tous rayons1
LyonACT589600,25Linge de maison1
BordeauxACT589600,3Enfant1
ParisACT589631800Femme0
ParisACT58963956Homme0
ParisACT589636943Enfant0
ParisACT589639699tous rayons1
LilleACT58963200Femme0
LilleACT589631956Homme0
LilleACT589633943Linge de maison0
LilleACT589636099tous rayons1
LyonACT589636548Linge de maison1
BordeauxACT589632365Enfant1

 

When I select "tous rayons" I would like to show that :

But I show that :

Bordeaux and Lyon stores do not appear because they do not have "tous rayons" values ​​in the "rayon" column.

Is it possible to transform the segment "Rayon" so that "tous rayons" integrates the lines where column "Tous rayons" = 1.

 

I tried the filter hierarchy but it does not answer my problem. In this exemple Bordeaux Store is missing.

 

Thank's for your help.

 

  • Hi   Anonymous ,

    Try dax like below to create a new column:

    Rayon2 = IF('Table'[Rayon]="tous rayons"||'Table'[Tous rayons]=1,"tours rayons",'Table'[Rayon])

     

    Then use the column to be slicer:

     

    Wish it is helpful for you!

    Best Regards

    Lucien

5 Replies

  • v-luwang-msft's avatar
    v-luwang-msft
    Icon for Community Support rankCommunity Support

    Hi   Anonymous ,

    Try dax like below to create a new column:

    Rayon2 = IF('Table'[Rayon]="tous rayons"||'Table'[Tous rayons]=1,"tours rayons",'Table'[Rayon])

     

    Then use the column to be slicer:

     

    Wish it is helpful for you!

    Best Regards

    Lucien

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello v-luwang-msft, thank you for your reply.

      When you select 'Linge de maison' do you see Lille and Lyon or only Lille?

       

      • v-luwang-msft's avatar
        v-luwang-msft
        Icon for Community Support rankCommunity Support

        HI Anonymous ,

        It will only show Lille.Lyon, due to restructuring, was assigned to  tours rayons.

         

         

         

        Best Regards

        Lucien

  • v-luwang-msft's avatar
    v-luwang-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

    Has your problem been solved, if so, please consider Accept a correct reply as the solution to help others find it.

     

    Best Regards
    Lucien