Forum Discussion
Filter visual by measure not working
Hi,
I have one measure called "CustomerScore" which i want to filter by another measure (lastquarterscore). Everything seems to working fine but filterining not happening. I couldn't able to drage a measure on Page filter. However, I can drag the measure to Visual Filter but can't able to select anything.
I can't share the original report but i am sharing a test report where you can see the problem.
Please help. I can calculate the filtered measure directly in DAX but I don't want that. i just want to filter the page by a calculated measure.
Right I now understand what your issue is. You can fix that by creating a TRUE/FALSE column in your Calendar1 table like this:
IsLastQuarter = VAR _today = FILTER(ALL(Calendar1), Calendar1[Date] = TODAY()) VAR prevQ = CALCULATETABLE(PREVIOUSQUARTER(Calendar1[Date]), _today) RETURN IF(Calendar1[Date] IN prevQ, TRUE, FALSE)Then filter your page on the column IsLastQuarter and then your datetable is always filtered to the last quarter.
On your other question; PREVIOUSQUARTER() takes a table as input and TODAY() returns a datetime value and thus is not valid. A filtered table derived from Calendar1 is a valid input. Hope this helps you out!
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂
12 Replies
- socksinboxHelper I
- JarroVGITResident Rockstar
The reason why you can't filter on that measure is because you would create an circular reference. The Measure is evaluated based on the filtered context, but then you want tog filter te context based on the measure (which would be re-evaluated etc).
However, in your specific case: you say you have two measures (lastquarterscore and CustomerScore). In the pbix I only see one measure (lastquarterscore). I don't understand what you are trying to achieve by 'filtering on lastquarterscore' as that measure returns a scalar value for the current context. What you might need is a calculated column and evaluate for every row in the table a certain expression and then use that column as a filter.
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂
- socksinboxHelper I
JarroVGIT - CustomerScore is a measure i.e. sum of customerscore but not explicitly defined.
Right now, customerscore shows the sum of all the rows. However, I just wanted to show the sum for only last quarter. Currently, last quarter measure is doing it and it's hardcoded for now.
So I just want to filter customer score where lastquarter value evalutes to 1.