Forum Discussion
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 Vente | code_Indicateur | Valeur | Rayon | Tous rayons |
| Paris | ACT58960 | 0,8 | Femme | 0 |
| Paris | ACT58960 | 0,5 | Homme | 0 |
| Paris | ACT58960 | 0,75 | Enfant | 0 |
| Paris | ACT58960 | 0,7 | tous rayons | 1 |
| Lille | ACT58960 | 0,85 | Femme | 0 |
| Lille | ACT58960 | 0,68 | Homme | 0 |
| Lille | ACT58960 | 0,2 | Linge de maison | 0 |
| Lille | ACT58960 | 0,6 | tous rayons | 1 |
| Lyon | ACT58960 | 0,25 | Linge de maison | 1 |
| Bordeaux | ACT58960 | 0,3 | Enfant | 1 |
| Paris | ACT58963 | 1800 | Femme | 0 |
| Paris | ACT58963 | 956 | Homme | 0 |
| Paris | ACT58963 | 6943 | Enfant | 0 |
| Paris | ACT58963 | 9699 | tous rayons | 1 |
| Lille | ACT58963 | 200 | Femme | 0 |
| Lille | ACT58963 | 1956 | Homme | 0 |
| Lille | ACT58963 | 3943 | Linge de maison | 0 |
| Lille | ACT58963 | 6099 | tous rayons | 1 |
| Lyon | ACT58963 | 6548 | Linge de maison | 1 |
| Bordeaux | ACT58963 | 2365 | Enfant | 1 |
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
Community 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
- AnonymousNot 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
Community Support
HI Anonymous ,
It will only show Lille.Lyon, due to restructuring, was assigned to tours rayons.
Best Regards
Lucien
- v-luwang-msft
Community 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