cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SWATIC
Regular Visitor

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()

2 :- Previous Price = CALCULATE(average('BRAND WISE PRICE-VERT'[PRICE1]),DATEADD('date'[Date].[Date],-1,MONTH))
 
for e.g.
DATEPRODUCTCURRENT DAY PRICEPREVIOUS DAYS PRICE
01-12-2020A9000
02-12-2020B600900
03-12-2020C150600
04-12-2020D200150
 
1 ACCEPTED SOLUTION
RicoZhou
Community Support
Community Support

Hi @SWATIC 

Please check whether you build a relationship between BRAND WISE PRICE-VERT  Table and Data table by Date column.

1.png

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.

2.png

If we delete the relationship, it will make the result to show previous price equal to current price.

3.png

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. 

View solution in original post

6 REPLIES 6
RicoZhou
Community Support
Community Support

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

amitchandak
Super User IV
Super User IV

@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

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

 

Yes using below date :

 

Created Date table :-

1 :- date = CALENDARAUTO()

RicoZhou
Community Support
Community Support

Hi @SWATIC 

Please check whether you build a relationship between BRAND WISE PRICE-VERT  Table and Data table by Date column.

1.png

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.

2.png

If we delete the relationship, it will make the result to show previous price equal to current price.

3.png

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. 

View solution in original post

amitchandak
Super User IV
Super User IV

@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]))

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

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))

 

 

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Top Solution Authors
Top Kudoed Authors