Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Rohan459
Frequent Visitor

Revived customer

Hi,

 

I'm trying to define customers according to whether they have "woken up". We have done some marketing campaigns and want to review their results. For this I would like to see the following: customers who have bought products before 2019 and have stopped and who have made another order afer july 2022.

 

So imagine you have been a customer to our company and for whatever reason stopped purchasing, but after you have seen our marketing campaigns you decided to place an order again. 

 

The datamodel is really simple. I have 2 tables, 1 with order lines with orderNo_, customerId, itemNo_, amount, orderDate and one with customer data.

 

Does anyone from the Power BI community have any ideas on how to tackle this?

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @Rohan459 

Thanks for reaching out to us.

I just want to confirm if you resolved this issue? If yes, you can accept the answer helpful as the solution or share you method and accept it as solution, thanks for your contribution to improve Power BI.

If you need more help, please let me know.

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

speedramps
Community Champion
Community Champion

 

Try these measures ...

HasPre2019 = NOT(CALCULATE ( ISEMPTY(sales), Sales[orderdate] < DATE(2019,01,01)))


HadStop = 
 
CALCULATE ( ISEMPTY(sales), 
Sales[orderdate] >= DATE(2019,01,01) && Sales[orderdate] < DATE(2020,07,01))

HasPostJuly2020 = NOT( CALCULATE ( ISEMPTY(sales), Sales[orderdate] >= DATE(2020,07,01)))

HasReturned =
IF([HasPre2019] && [HadStop] && [HasPostJuly2020], 1, 0)
 
then add a blank report page canvas with a report visual with the Customer and HasReturned
 
How it works:-
 
the CALCUATE command changes the filter context using the order date
 
the ISEMPTY command is good method of checking if data exist or not and is much faster than counting and then checking for > 0
 
the NOT command reverses the ISEMPTY from false to true.   
i.e. returns true if it has data for the order date filter context,  and false if it does not.

 

speedramps_0-1668535640782.png

Thanks for reaching out for help.

I put in a lot of effort to help you, now please quickly help me by giving kudos.

Remember we are unpaid volunteers and here to coach you with Power BI and DAX skills and techniques, not do the users job for them. So please click the thumbs up and accept as solution button. 

If you give someone a fish then you only give them one meal, but if you teach them how to fish then they can feed themselves and teach others for a lifetime.  I prefer to teach members on this forum techniques rather give full solutions and do their job. You can then adapt the technique for your solution, learn some DAX skills for next time and soon become a Power BI Super User like me. 

One question per ticket please. If you need to extend your request then please raise a new ticket.

You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you ! 

 

 

 

 

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.