Hi Ashish,
Thank you so much for the answer provided.
Although your solution gives expected result, it still requires a lot of manual work. For example:
- I probably need to do similar calculation for each record in initial 'table'
- What if there is a gap in periods between two 'rows' of data?
I really hoped there is some VBA script or Power Query trick to do this. I know how to do this in SQL Server but I don't want to use it in this case. In SQL Server I would create DimDate table with all dates on day level of granularity and then I would just
need to join this DimDate table with my data as:
select X.TransactionDate, D.DateKey as PeriodDate
from InputData X
inner join DimDate D on D.DateKey between X.PeriodBeginDate and X.PeriodEndDate
This would "expand" my initial data and give me exactly the result I am after.
Thanks,