Forum Discussion
Overall % Change to a selected Date
Hello,
I am looking to get the % change to a selected date in a line chart. I am have wrote this dax function but it is not retreiving anything.Not sure what I went wrong here to get the difference between the selected location price index to subtract it from the original min price index on that visual. Then probably divide that by the miniumn price index as well to get the %.
Overall % Change to a selected Date =
Calculate (AVERAGE(Dim_New_Home_Price_Index[Price Index Value],selectedvalue(Calendar[Date])) - Calculate (average (Dim_New_Home_Price_Index[Price Index Value ]), min(Calendar[Date]))))
5 Replies
- lbendlinSuper User
Don't use SELECTEDVALUE inside CALCULATE. Use variables.
Please provide sanitized sample data that fully covers your issue.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523- kalkhudaryHelper IV
Hello Bendlin,
Here is a sample of the data.
Date Province City New Housing & Residential Type Price Index Value 2017-01 Alberta Edmonton House only 100 2017-01 Alberta Edmonton Land only 100 2017-01 Alberta Edmonton Condo Only 100.2 2017-04 Alberta Edmonton House only 100.2 2017-04 Alberta Edmonton Land only 99.4 2017-04 Alberta Edmonton Condo Only 100.4 2017-07 Alberta Edmonton House only 99.8 2017-07 Alberta Edmonton Land only 99.9 2017-07 Alberta Edmonton Condo Only 100.1 2017-10 Alberta Edmonton House only 99.7 2017-10 Alberta Edmonton Land only 100 2017-10 Alberta Edmonton Condo Only 99.3 2018-01 Alberta Edmonton House only 99.7 2018-01 Alberta Edmonton Land only 100.1 2018-01 Alberta Edmonton Condo Only 98.6 2018-04 Alberta Edmonton House only 99.3 2018-04 Alberta Edmonton Land only 100.2 2018-04 Alberta Edmonton Condo Only 97.9 2018-07 Alberta Edmonton House only 99.5 2018-07 Alberta Edmonton Land only 100.5 2018-07 Alberta Edmonton Condo Only 97.6 2018-10 Alberta Edmonton House only 99 2018-10 Alberta Edmonton Land only 100.5 2018-10 Alberta Edmonton Condo Only 94.7 When I click on one part of the line, it will show me in the card above, the %change from 2017 to the date clicked on in the visual.
Hope I was able to explain it well. Would really appreciate your help on this.
- lbendlinSuper User