The model is very simple where you have 3 campaigns starting & ending at different dates and for each units are being sold. The goal is to create an axis which simply shows the amount of days (offset) from the start date of each campaign so they can be nicely compared. So the ask is, how can I make a this offset as a calculated column which I can then use as an axis?
Okay, no problem. One thing is that your Excel file didn’t come through in the initial post. Can you please repost that and I will get you a calculated column solution shortly based on that data.
I would characterize this solution as “quasi–dynamic”. I created a disconnected table to hold the Campaign IDs and the Campaign Start Dates. You can update the campaign start dates in this table in Power Query and when you close and apply, it merges these dates with the main data based on Campaign ID.
I hope this is helpful. Full solution file attached below.
My god, that’s an incredibly simple solution. Even if the data model wouldn’t be normalized as you did, a virtual table could be created or a calculate(min…) could be done which could then be leveraged in the simple datediff. Simple & nice!
Thanks
PS: I still have an old one I need to get back to about concatenating and multiple relationships for which I still need to provide some sample data. Will do that shortly.
The REALLY cool thing would be if the new Dynamic M parameters worked in Import mode. Then we could have the user select the campaign dates in a slicer/slider, which could then feed in dynamically to PQ.
But as you say, there are other techniques that could be used to mimic similar functionality…