cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

brand switch analysis

Hi,

 

I want to do a brand switch analysis, 

 

i have following table, where in 2020/6 the brand "ABC" did an advertising campaign for their product "water".

 

I want to get 3 values:

1) new customer (during campaign) -> 1 (customer id no. 2)

2) brand switch (during campaign) -> 1 (customer id no. 1, switch from DEF to ABC)

3) repeat (no change in purchase behaviour)  -> 1 (customer id no.3 , no change before and after the campaign bought ABC's water)

 

year-monthcustomer idproduct (bought)brand nameadvertising flag
2020/51waterDEF 
2020/53waterABC 
2020/62waterABCyes
2020/61waterABCyes
2020/63waterABCyes
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IX
Super User IX

Re: brand switch analysis

@nabe , for the new customer, you can column/measure rank of Month inside the customer , so rank one means new.

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

View solution in original post

2 REPLIES 2
Highlighted
Super User IX
Super User IX

Re: brand switch analysis

@nabe , for the new customer, you can column/measure rank of Month inside the customer , so rank one means new.

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

View solution in original post

Highlighted
Helper II
Helper II

Re: brand switch analysis

thanks, these articles were helpful!

I thought I'd share my solution quickly.

 

new customer=

RANKX(
FILTER(
     'table',
          [product_name] = EARLIER([product_name])
   && [customer_id]=EARLIER([customer_id])

),
[date],,ASC
)
 
 
brand-change customer =
IF (
COUNTAX (
FILTER (
        'table',
              [customer_id] = EARLIER([customer_id])
       && [date] <= EARLIER([date])
       && [product_name] = EARLIER([product_name])
       && [brand name] <> EARLIER([brand name])
), [customer_id]
) = 1,
1,
0
)

Helpful resources

Announcements
Meet the 2020 Season 2 Power BI Super Users!

Meet the 2020 Season 2 Power BI Super Users!

Find out who's part of the program this season, and welcome the new Super Users.

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Featured Data Story of The Month

Featured Data Story of The Month

All Data Stories Gallery contributions are reviewed for each month. We select a contribution and feature the community member the following month.

Power BI Dev Camp - Developing with .NET Core

Power BI Dev Camp - Developing with .NET Core

Learn how to develop custom web applications for Power BI using .NET Core 3.1 and .NET 5.

Top Solution Authors
Top Kudoed Authors