1
votes

I have got a table that only contains two column Legend (for Dates) and EOD Volume (for volume) as shown below.

enter image description here

I need to calculate the difference between the previous date volume. For example to calculate the difference between Feb 29 to March 2nd, it will be ((1469-1877) / 1469) * 100%. How to do create this measure in power BI. And the data also contains weekends and weekdays and i will need the analysis for all dates regardless of weekends and/or weekdays. Could someone please help me on this. Thank you in advance.

1

1 Answers

0
votes

My propose solution works in a table at day granularity. Additionally, to handle working day the best-practice is to manage it as a binary attribute in the back-end because working days differ country by country so there is no standard dynamic way to handle them.

Possible Solution:=
VAR _YESTERDAY = CALCULATE(MAX('Fact'[EOD Volume]), PREVIOUSDAY('Calendar'[CalendarKey]))  
VAR _TODAY = CALCULATE(MAX('Fact'[EOD Volume]))
RETURN
DIVIDE(_TODAY - _YESTERDAY, ABS(_YESTERDAY))