Forum Discussion
Or Condition on page filter
- 6 years ago
That makes sense. Yet, I was hoping something that needed fewer manipulations (adding each filter individually is a bit repetitive) but I guess I can do it.
The other solution I found is to create a new column by concatenating FD1 and FD2. Then I added an advanced filter on the page and that requires the concatenated variable to contains "X".
Btw, since I'm a newcomer to Power Bi, I'm not sure about how to deal with "First you will need an unrelated filter table, so add a new table to the data model that contains all values of X that you would want to filter for (you can do this in the Query Editor by duplicating a column of FD1 or FD2). Remove duplicates so this only has each value once. I called the table Filter and the column X, so we will have 'Filter'[X] to reference this column in DAX."
I duplicated the column "Première fédération déclarée" (FD1) in base and name it "Filtre", then I removed the duplicates. I then created a new table named "Filtre" by doing this:
Maxfran I prefer to create the new tables in Power Query Editor rather than DAX if possible just for performance purposes, but if what you did is working that is fine too.
To create it in Power Query Editor:
In the Transform Data Power Query Editor you can duplicate the base query (right click on it in the Queries pane). Then select the FD1 column and convert to list (find the button in the ribbon). Set the data type for this list and close and apply changes.
Then your measure in report should be fine, but yes you are right it cannot be used in page visual since it's a measure, so you will need to add it to each visual level filter on the page.
- Maxfran6 years ago
Helper I
Thanks for your reply. I wanted to use it one the whole page so a measure won't work as I understand...
I'll try to figure something else 🤔
- AllisonKennedy6 years ago
Community Champion
Maxfran The measure can work on whole page, just requires a bit more setup because you'll have to add it as a filter to each visual. Once you've done that though, the new column for X can be added as a page level filter or as a slicer, and that will change the value of all the measures that you previously added as filters to the visuals, and thereby will update everything on the page. Voila!
Does that make sense?
- Maxfran6 years ago
Helper I
That makes sense. Yet, I was hoping something that needed fewer manipulations (adding each filter individually is a bit repetitive) but I guess I can do it.
The other solution I found is to create a new column by concatenating FD1 and FD2. Then I added an advanced filter on the page and that requires the concatenated variable to contains "X".