Forum Discussion
Filter visual by measure not working
- 6 years ago
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! 🙂
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! 🙂
Thanks JarroVGIT. I am trying to create this measure but it's not working- give me below error.
https://i.imgur.com/GPiGDPn.png
Appreciate if you can do in the test file I shared
- JarroVGIT6 years ago
Resident Rockstar
Sorry if this wasn't clear, but the dax is a calculated column in the Calendar1 table, not a measure.
I created it using your file, but had to replay today() with today()-6 because today's date is not in your Calendar1 table but in a reallife scenario it would be. - socksinbox6 years ago
Helper I
Oh. I got that. So there's no way to filter by measure on the visual or page.
Thanks alot for helping me.
- JarroVGIT6 years ago
Resident Rockstar
But why do you need it to be a measure? Using a column is a perfect valid case in your use case and requirements and you can use that to filter on a page level?
Anyway, please mark the solution so others can find answers to the same question more easily:)
Thanks! - socksinbox6 years ago
Helper I
Measure is more efficent in terms of column storage and I just wanted to replicate what I could able to do in Tableau.
Anyways, I have already marked the previous post as accepted solution.
Thanks a lot dear for helping me out