The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hey,
I am trying to create a KPI card on my dashboard and want my reference year (within the trend field) to always compare my current year to 2019 sales. So whatever year I filter my dashboard by, it should always compare my sales to 2019.
Right now, I have it set as
Revenue Period 2019 = CALCULATE((SUM(transactions[Total]) - SUM(transactions[Total_Tax])), PARALLELPERIOD(filter_date[Date], -3, YEAR))
This works when I set my filters to the year 2022 and it compares it to 2019, but when I change by filter to 2021, it begins comparing to the 2018 period.
I also tried this method,
Revenue Period 2019 =
var _diff = 2019 - maxx(allselected('Date'), 'filter_date'[Year]) )
return
CALCULATE((SUM(transactions[Total]) - SUM(transactions[Total_Tax])), PARALLELPERIOD(filter_date[Date], _diff, YEAR))
But this doesn't work for me either.
Any help on this will be very appreciated.
Solved! Go to Solution.
@aayush_a , Also use date from date table in the measure
Revenue Period 2019 =
var _diff = 2019 - maxx(allselected('Date'), 'Date'[Year]) )
return
CALCULATE((SUM(transactions[Total]) - SUM(transactions[Total_Tax])), PARALLELPERIOD(Date[Date], -3, YEAR))
or
Revenue Period 2019 =
var _diff = 2019 - maxx(allselected('Date'), 'Date'[Year]) )
return
CALCULATE((SUM(transactions[Total]) - SUM(transactions[Total_Tax])), dateadd(Date[Date], -3, YEAR))
@aayush_a , Also use date from date table in the measure
Revenue Period 2019 =
var _diff = 2019 - maxx(allselected('Date'), 'Date'[Year]) )
return
CALCULATE((SUM(transactions[Total]) - SUM(transactions[Total_Tax])), PARALLELPERIOD(Date[Date], -3, YEAR))
or
Revenue Period 2019 =
var _diff = 2019 - maxx(allselected('Date'), 'Date'[Year]) )
return
CALCULATE((SUM(transactions[Total]) - SUM(transactions[Total_Tax])), dateadd(Date[Date], -3, YEAR))
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |