Forum Discussion
Changing the date when comparing values
- 6 years ago
Hi Anonymous ,
You need measures as below:
For +1 day:
+1day = SELECTEDVALUE('Table'[Date])+1+1 value = SELECTEDVALUE('Table'[Value])+1For +8 days:
+8 day = SELECTEDVALUE('Table'[Date])+8+8 value = SELECTEDVALUE('Table'[Value])+8Finally ,you will see:
For the related .pbix file,pls click here.
Best Regards,
Kelly
In case you need for comparison, First, create a calendar table and mark it as Date. Join it with the date of your table
One Day behind =Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Day))
8Day behind =Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-8,Day))
One Day ahead =Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],1,Day))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s.
Refer
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
I created the calendar table and joined it with my table. The comparing is going good but my dates are still staying the same.
- amitchandak6 years agoSuper User
Please provide a sample what you want to show vs what you are getting
- Anonymous6 years agoNot applicable
I updated the post with a foto of the expected result I'm trying to get.
- amitchandak6 years agoSuper User
Not sure I still got it.
But if we want to show date of 7th and show diff 6th and 7th we use -1 day measure
but If want show same on 6th we will use +1 day measure