Forum Discussion
Dynamic page filter based on attribute's value
Thanks a lot for the detailed answer.
I think what you propose is close to what I want, except that I have some troubles understanding this line :
IF(MAX('Big table'[Month number])=_month,1,0)
In particular, what is the purpose of the MAX() aggregation in this formula? I don't understand why an aggregation is needed here.
NOTE : Multiple rows in the big table should match the attribute of the small table. I don't think this changes something in your answer.
Hi, Anonymous
When we use the max function like this in a measure, we can get the column value of the current row, so (max ('Big table '[month number]) is to get the value of [month number] of each current line of visual chart obtained here.
In other words, this MAX() function acts as an aggregation, but it only targets the current line. Do you understand what I mean?
More info about the MAX() function
Thank you very much!
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous5 years agoNot applicable
Alright I see, thanks for the explanation.
Now about the behavior of this : It's actually kind of weird because it doesn't give the same result as applying a page filter (as explained in the initial question) whereas conceptually for me this should do the same.
It appears the page filter filters more, meaning that there are more rows with your solution than with the page filter (and the right solution is with the page filter : I compared the data with what's on the database.)
Could it be a problem of filtering / computation order ? It also appears that for some visuals it works fine and for some others it doesn't...
If you have any idea of what's happening that would be great, otherwise I guess I'll continue investigating on my own since I cannot upload any of the data in here to illustrate specifically the problem.
Thanks
- v-robertq-msft5 years agoCommunity Support
Hi, Anonymous
As far as I’m concerned, the method I used works on the visual filter, and I have never tried this in the page filter. I think you can try to apply the visual filter for each visual within your page and check if all the visuals have been correctly filtered.
If not, you can tell me what kind of visual failed to be filtered, and I will also do some research.
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous5 years agoNot applicable
Actually it appears your method cannot be applied as a page filter.
Anyway I applied it as a visual filter on each visual of the page. Here are two pictures showing the difference with your method and the initial page filter I mentioned (graying out sensible information) :
Here is with your method (light blue is a Max and dark blue is a Min):
and here is with the page filter :
(the y scale didn't change from one image to the other) So this confirms the difference. And to answer your other question : Actually I think it fails on all the visuals except Tables.