Forum Discussion
PREVIOUS DAYS VALUE WITH CURRENT DATE VALUE
I want to show previous days value with current days value.
Tried below formula but in previous days value shown same as current days value. Particular issue is still pending.
Created Date table :-
1 :- date = CALENDARAUTO()
| DATE | PRODUCT | CURRENT DAY PRICE | PREVIOUS DAYS PRICE |
| 01-12-2020 | A | 900 | 0 |
| 02-12-2020 | B | 600 | 900 |
| 03-12-2020 | C | 150 | 600 |
| 04-12-2020 | D | 200 | 150 |
- Anonymous5 years ago
Hi SWATIC
Please check whether you build a relationship between BRAND WISE PRICE-VERT Table and Data table by Date column.
I have a test by your calculated column:
PREVIOUS DAYS PRICE = CALCULATE(average('BRAND WISE PRICE-VERT'[CURRENT DAY PRICE]),DATEADD('date'[Date],-1,MONTH))It works well.
If we delete the relationship, it will make the result to show previous price equal to current price.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
6 Replies
- amitchandak
Super User
SWATIC , Do not use .date, try like
Day behind Sales = CALCULATE(average('BRAND WISE PRICE-VERT'[PRICE1],dateadd('Date'[Date],-1,Day))
Day behind Sales = CALCULATE(average('BRAND WISE PRICE-VERT'[PRICE1],previousday('Date'[Date]))- SWATICRegular Visitor
Sorry Sir not resolve issue, shown below error :
1st formula :-Previous Price1 = CALCULATE(AVERAGE('BRAND WISE PRICE-VERT'[PRICE1],PREVIOUSDAY('date'[Date])))Error :- Too many arguments were passed to the AVERAGE function. The maximum arguments count for the function is 1.
2nd formula :- Not resolved same price shown in previous column.Previous Price = CALCULATE(average('BRAND WISE PRICE-VERT'[PRICE1]),DATEADD('date'[Date],-1,day))
- amitchandak
Super User
SWATIC , make sure you are using the date from the calendar. Find the attached file after signature.
Also when you add a product. None of the product on the sample has value for last day, so you will get two rows, one for current and one for the next day for last day
- SWATICRegular Visitor
Yes using below date :
Created Date table :-
1 :- date = CALENDARAUTO()
- AnonymousNot applicable
Hi SWATIC
Please check whether you build a relationship between BRAND WISE PRICE-VERT Table and Data table by Date column.
I have a test by your calculated column:
PREVIOUS DAYS PRICE = CALCULATE(average('BRAND WISE PRICE-VERT'[CURRENT DAY PRICE]),DATEADD('date'[Date],-1,MONTH))It works well.
If we delete the relationship, it will make the result to show previous price equal to current price.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Hi SWATIC
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.
Best Regards,
Rico Zhou