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".
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?
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".
- AllisonKennedy6 years ago
Community Champion
Maxfran Concatanated column was my first thought, but not knowing how your data is structured I wasn't sure what that would pull through that you don't want. For example:
If X=70 and FD1=707 and FD2=90, the concatanated column might look something like 707-90, it both would CONTAIN 70 even thought neither column was EQUAL to 70. Since you specified = I stayed away from that option, but if that's not an issue for your data or if you can get the format of X and the concatanated column right so it's not a problem, then you're right it will be much less laborious than my solution. 🙂
- Maxfran6 years ago
Helper I
AllisonKennedy wrote:Maxfran Concatanated column was my first thought, but not knowing how your data is structured I wasn't sure what that would pull through that you don't want. For example:
If X=70 and FD1=707 and FD2=90, the concatanated column might look something like 707-90, it both would CONTAIN 70 even thought neither column was EQUAL to 70. Since you specified = I stayed away from that option, but if that's not an issue for your data or if you can get the format of X and the concatanated column right so it's not a problem, then you're right it will be much less laborious than my solution. 🙂
Hi,
Thanks for your reply. As you explain, this solution is viable for my type of data.
I concatenated FD1 and FD2 in a new variable with the syntax: FD1_FD2_ (with underscores). Then when I use this variable as a filter, I select "contains" and state the modality "X_" (with an underscore).
Using underscores allows me to avoid the fact that X could be contained in another modality (as you explained, e.g. 70 is in 707).
- AllisonKennedy6 years ago
Community Champion
Maxfran You know your data better than me, so I hopefully you're right, but your reasoning is not fully developed, so I am posting this for others and in case your data is not consistent. Underscore will help some, but not in the example I gave, as 707_707 will still CONTAIN 70. So basically you need to carefully consider your values for X and make sure that they none of the possible X values can ever contain another.
For example, setting X value to 7, 7 would be contained in 7, 70 and 700, but you really only want the items that are equal to 7 (so not the 70 and 700).
Is X a number or text? If it's number you could get around this problem by setting the X to text and forcing it to always be exactly the same number of digits.
7 would become 007
70 would become 070
700 would stay 700
Then setting your X value to 007 will never be contained in 070 or 700.
Does that make sense?
Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos.
I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query.
https://sites.google.com/site/allisonkennedycv