Forum Discussion
[Single number card] Create visual filter where year=current year
- 9 years ago
...meanwhile I've got a solution for this case:
I just created a measure and integrated the filter argument in there:
sum of price in current year = CALCULATE(AVERAGE(Tabelle12[price]);Tabelle12[year]=YEAR(TODAY()))
Thanks for your help anyway!
When you mean, dynamic - what other visual is driving the context for this card ?
eg: If you click the bar for "year" in another visual, then the corresponding sum should be displayed in the card - Is that how you are building this ?
If possible, please share a screenshot
Hi ceebu,
you are right, a screenshot might do a good job in this case:
I want to create a filter, which automatically selects the current year, instead of manually clicking it as shown in the screenshot.
Can you help me with that?
- ceebu9 years ago
Advocate I
If i understand you right, you want to be able to filter by the current year without manually selecting the year everytime it changes - Right ?
If yes, you should be able to use the TopN filtering method.
See this link : http://www.cloudfronts.com/power-bi-new-updates-date-slicer-top-n-filter-and-data-label-improvements/
Is your Date column formatted as Date type ? In that case you should be able to filter for the latest date - Which will give you current year.
- ceebu9 years ago
Advocate I
You should be able to use the TopN filter to select the values dynamically.
If your date column is formatted as date type, then you can select "Latest date" option to show current year.
- wech7479 years agoFrequent Visitor
Hi ceebu,
thank you very much for your answer.
Unfortunately column isn't formatted as date type, it hast just the data type 'number'.
When using the TopN filter as described, I unfortunately don't receive the correct numbers.Is there any other possibility to solve this problem?
Kind regards- ceebu9 years ago
Advocate I
When formatted a numbers, do you see the option "Top" under "Show Items" ? You could probably try Top "1" and in the "ByValue" field, use the date column.