Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
pawelj795
Post Prodigy
Post Prodigy

Day on Day difference for each product

Hi,
I have a table like below with prices of my products.

DateProductPrice

13.05.2021

A

5
13.05.2021B4
14.05.2021A8
14.05.2021B5
15.05.2021A6
15.05.2021B9

 


Now, I want to calculate the daily % difference between these prices for each product.
My desired result table should look like something like the below.

pawelj795_0-1621850369078.png


Thanks in advance for any help !

9 REPLIES 9
Jihwan_Kim
Super User
Super User

Hi, @pawelj795 

Please check the below picture and the sample pbix file's link down below.

I suggest having a dim-date table like below.

 

Picture1.png

 

Price Measure = SUM('Table'[Price])
 
Day on Day Diff =
VAR previousdayprice =
CALCULATE ( [Price Measure], DATEADD ( Dates[Date], -1, DAY ) )
RETURN
DIVIDE ( [Price Measure], previousdayprice )
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


 

    Microsoft MVP




If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.





LinkedIn
Visit my LinkedIn page





Outlook Booking
Schedule a short Teams meeting to discuss your question.




@Jihwan_Kim 
Thanks for weighing in.

You forgot to add -1 in your measure.

The difference for product A is 60%, not 160%.
Where add this -1 in your measure?

Hi, @pawelj795 

Thank you for your feedback.

Please check the below.

 

Picture4.png

 

Day on Day Diff =
VAR previousdayprice =
CALCULATE ( [Price Measure], DATEADD ( Dates[Date], -1, DAY ) )
RETURN
IF(not ISBLANK([Price Measure]),
DIVIDE ( [Price Measure]-previousdayprice, previousdayprice )
)
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


 

    Microsoft MVP




If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.





LinkedIn
Visit my LinkedIn page





Outlook Booking
Schedule a short Teams meeting to discuss your question.




@Jihwan_Kim 
I need to modify your measure slightly.
I want to show only products, which price changed yesterday (or the current week).

This could be a simple table.

 

Product% Difference change (yesterday)Price beforePrice after

A

80%1018
B70%1017
C60%1016
D50%1015

 

Hi, @pawelj795 

Is the above input or output?

 

 

Seeing above, A / B / C / D all products have changes in the price.


 

    Microsoft MVP




If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.





LinkedIn
Visit my LinkedIn page





Outlook Booking
Schedule a short Teams meeting to discuss your question.




@Jihwan_Kim 
It is the output.

This table must show only products, which prices changed yesterday. (it is another table to the one you help me created before)

Thanks, it's working!
Now, I want to add another measure, which shows only products, which prices changed yesterday, a current week, etc. How to do that?

@pawelj795 

I cannot understand your question.

Share your idea ( or drawing of the table) about how your desired outcome looks like.


 

    Microsoft MVP




If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.





LinkedIn
Visit my LinkedIn page





Outlook Booking
Schedule a short Teams meeting to discuss your question.




Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.