Forum Discussion
Calendar Based on Last Date
I am trying to create a calendar in Power Bi that predicts a customers future service dates based on the last service date that we have recorded for them. I am able to create a a measure that shows the next pick up date, but what i am looking for is all of the service dates for the rest of the calendar year.
Below is my desired result:
| Customer Name | Last Pickup Date | Next Pickup Date | Service Frequency |
| Customer A | 5/1/2019 | 6/1/2019 | Monthly |
| Customer A | 6/1/2019 | 7/1/2019 | Monthly |
With 5/1/219 being the most recent service date we have recorded for this customer, I would need the rest of the dates to populate based off that and service frequency. Is something like this possible in Power Bi?
Thanks for any ideas in advance!
13 Replies
- AnonymousNot applicableIf you have measure1 that gets first date, measure2 that gets second and so on, you can use a calculated table using a set of UNION that collates all of your calculated tables for each measure.
Unfortunately measure returns a scalar value (so 1 value) but maybe also a CALCULATETABLE can help- dmutkaFrequent Visitor
Thanks for the reply! I have been messing around with different things but i am unsure of how to accomplish my goal based on your feedback. It is primarily because I do not understand how CALCULATETABLE works fully. i have watched few tutorials but I am still struggling. would you be able to lend a hand with sample DAX that you think would work? Thanks in advance!
Anonymous wrote:
If you have measure1 that gets first date, measure2 that gets second and so on, you can use a calculated table using a set of UNION that collates all of your calculated tables for each measure.
Unfortunately measure returns a scalar value (so 1 value) but maybe also a CALCULATETABLE can help
- Ashish_MathurSuper User
Hi,
You have shared the desired outcome, not the raw data. Please share that as well.
- dmutkaFrequent Visitor
Ashish_Mathur Here is a link to Sample data. As mentioned, I am looking up the customers last service date, and then trying to create a new table based off the customer selected/service frequency, that will show predicted service dates in the future. Any help, if possible, would be appreciated.
Thanks!
- Ashish_MathurSuper User