Forum Discussion
Anonymous
4 years agoNot applicable
Can't get the KPI visual to work correctly
Hi all, Over the past 2 days I've been eagerly trying to get the KPI visual to work the way I want to. I have a table with Sales figures from our database and used PQ to split the revenue val...
amitchandak
Super User
4 years agoAnonymous , Try like
RevenueCY = CALCULATE([Revenue],filter('Calendar', 'Calendar'[Year] = YEAR(TODAY()) ))
RevenuePY = CALCULATE([Revenue],filter('Calendar', 'Calendar'[Year] = YEAR(TODAY())-1 ))
or
other example
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
//Only year vs Year, not a level below
This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))
Make sure calendar is marked as date table