Forum Discussion
LaurenceSD
Advocate II
4 years agoFind a customers next booking
Hi, I've got something I'm struggling with, what I'm wanting to find out, for each record is where a guest booked to go next, so we can make some predictions, based on where the majority of guest...
- 4 years ago
Hi LaurenceSD Kitty-SD ,
According the data you provided,test to create the below column:
rank = RANKX(FILTER(data,data[ContactId]=EARLIER(data[ContactId])),format(data[BookDate],"YYYYMMDD")+data[BookId],,ASC,Dense)return = CALCULATE(MAX(data[MetaCountry]),FILTER(ALL(data),data[ContactId]=EARLIER(data[ContactId])&&data[rank]=EARLIER(data[rank])+1))Output result:
Did I answer your question? Mark my post as a solution!
Best RegardsLucien
Kitty-SD
4 years agoFrequent Visitor
Hi Jihwan_Kim ,
Thank you for looking into this for us! I've tried using the measure you suggested, but I'm getting the following error:
If you have any ideas as to why this is happening, that would be very helpful.
Thanks,
Kitty
Jihwan_Kim
Super User
4 years agoHi,
Thank you for your reply.
Please share your sample pbix file's link, and then I can try to look into it to come up with a more accurate solution. If the measure works in my sample data model but it does not work in your data model, I have no idea but I need to check what is the difference between mine and yours.