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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
garfieldhe
Employee
Employee

Find out group of customers with certain conditions

Hi everyone, I will need your help for the following:

Basically I have a data with this format:

 

DateCustomerJoin DateDays since joinWeek
1/1/2021A1/1/20210W0
1/1/2021B1/1/20210W0
1/2/2021A1/1/20211W0
1/1/2021B1/1/20211W0
1/2/2021C1/2/20210W0
1/3/2021B1/1/20212W0
1/3/2021C1/2/20211W0
1/3/2021D1/3/20210W0
1/3/2021E1/3/20210W0
… …     
1/15/2021A1/1/202114W2
1/15/2021B1/1/202114W2
1/15/2021C1/2/202113W2
1/15/2021E1/3/202112W2
… …     
2/1/2021B1/1/202131W5
2/1/2021C1/2/202130W5
2/1/2021D1/3/202129W5
2/1/2021E1/3/202129W5

What I want to do is can have a rolling graph by date to show the followings:

1. on that day, how many active customers in total

2. on that day, how many active customers has a certain active days since their join date >= a certain number (W5)

3. on that day, how many active customers has active record in a earlier predefined active days period based on the active days since their join date (need to have a record in W2)

  -- so basically each customer will have an array of Wx they have, for BCDE, their W array is {W0, W1, W2, W3, W4, W5}

  -- for A it may be {W0, W1, W2, W3, W4}

  -- for D it may be {W0, W1, W3, W4, W5}

4. find the intersection between #2 and #3

  -- since my first condition is group of customer reach W5 on certain date (2/1/2021)

  -- second condition is group of customer has record as W2 before

  -- intersect these 2 group to find the common one

5. calculate the rate between #3/#2

 

For example, this is what I am expecting, on 2/1/2021

On day 2/1/2021, I want to calculate the followings:  Notes:
Number of Active customers4B/C/D/EI already got this
Number of customers who have >= 29 days since joined5A/B/C/D/ENeed help on this
Number of customers who have record on their history after 12 days since joined4A/B/C/ENeed help on this
Number of customers who are in both >=12 and >=293B/C/ENeed help on this

I think I can find the first and second rows, but the 3rd and 4th rows, I have no idea how to do it with DAX. Can you please provide me some guidance?

 

I want to have seperate measure for each item above

 

Thanks in advance!

 

2 REPLIES 2
lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. Paste the data into a table in your post or use one of the file services. 

Hi Ibendlin, sorry I put the screenshot, reedited with text format, thanks in advance!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.