Forum Discussion
Filter Year Dynamically without Slicer
Hi guys,
I'm having problem filtering the year dynamically without using my slicer.
I'm summing the total of IDs for this year. I could add the year in the page filter but I don't want to keep toggling the year after another.
I would like the year change that reflect to the current year. This is the function I wrote but I'm not getting the correct value.
Measure = CALCULATE([Measure]),FILTER(Table1,Table1[YearNumber] >= YEAR(Now())))
Can someone please help? thanks
Many times, this is handled in the data or a measure via something along the lines of (column form):
Column = IF(YEAR(TODAY())=YEAR([Date]),1,0)
Then you just filter on 1
Greg_DecklerThank you :) I was able to get the correct count.
This is what I did
1) Create new column
Column = IF(YEAR(TODAY()) = YEAR([columnDate]),1,0)
2) Create new measure
Measure = CALCULATE(SUM(Table1[measure]),FILTER(Table1,Table1[Column]))
2 Replies
- Greg_DecklerCommunity Champion
Many times, this is handled in the data or a measure via something along the lines of (column form):
Column = IF(YEAR(TODAY())=YEAR([Date]),1,0)
Then you just filter on 1
- StuznetHelper V
Greg_DecklerThank you :) I was able to get the correct count.
This is what I did
1) Create new column
Column = IF(YEAR(TODAY()) = YEAR([columnDate]),1,0)
2) Create new measure
Measure = CALCULATE(SUM(Table1[measure]),FILTER(Table1,Table1[Column]))