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.
I am trying to calculate the % change over a slected range of dates from a 'Between' slicer. For example: If I selected the date range of 01-01-2010 to 02-02-2021 I would like to see the gross difference in value and peretnage change, by category. I have built measures to calculate this metric for 1 year and 6 months I just can't figure out how to do it dynamically, if its even possible at all.
Here are examples of my 1-year difference measures:
Solved! Go to Solution.
I believe I have found the solution, by plugging you var_min measure into my LOOKUPVALUE function I was able to retrieve the correct values. The final measures used were:
var _min = minx(ALLSELECTED('Date'),'Date'[Date])
and
earlier_value = LOOKUPVALUE('table'[value],'table'[Date_Col],var_min,'table'[Category],SELECTEDVALUE('table'[Category]))
Thank you!
@Anonymous , Not very clear, Do you want diff between max and min date ?
example
measure =
var _max = maxx(ALLSELECTED('Date'),'Date'[Date])
var _min = minx(ALLSELECTED('Date'),'Date'[Date])
return
calculate(countrows(Table), filter('Date', 'Date'[Date] =_Max)) - calculate(countrows(Table), filter('Date', 'Date'[Date] =_Min))
or
One year behind measure with date tbale
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
or
Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA
I believe I have found the solution, by plugging you var_min measure into my LOOKUPVALUE function I was able to retrieve the correct values. The final measures used were:
var _min = minx(ALLSELECTED('Date'),'Date'[Date])
and
earlier_value = LOOKUPVALUE('table'[value],'table'[Date_Col],var_min,'table'[Category],SELECTEDVALUE('table'[Category]))
Thank you!
Thank you for response,
To clarify what I am attepmting to do: I would like to create measures that would use the dates selected in the slicer to calculate the difference in the value from the earlier date to the later date. I am wondering I can use the slicer to input the date values into a LOOKUPVALUE function to find the values for the selected date for each category?