Forum Discussion
CUSTOMER SEGMENTATION AGAINST ORDER RANKING
Hi Team,
I have two tables - Customers and Orders. These tables are connected via the customer_id via a one-to-many relationship.
I created a calculated column in my customer's table named Redeemer_Status where customers are segmented into two - REDEEMER1 and REDEEMER2.
I created a stacked column chart where the column _Order Ranking in my orders table serves as the x-axis and customer_id (Unique) in my Y-axis. I then use the Redeemer_Status column as the legend but filtered it with only the REDEEMER1 and REDEEMER2.
I am so confused as to why there are REDEEMER2 that show up in the order ranking 1 instead they should only start to appear in the 2nd order onwards.
In this graph, there should be no REDEEMER2 in the column for order rank 1. The 141 REDEEMER2 is incorrect and should not appear there.
What did I do wrong?
7 Replies
- lbendlin
Super User
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523- Andrew_na_lang
Helper V
Customer Segmentation - based on order rank 1 or rank 2
Hi,
I need help!
So, in my orders table, I created two calculated columns -_____Redeemer 1 =VAR CustomerID = orders[customer_id]VAR _HC = orders[with HC]RETURNIF( CustomerID = orders[customer_id] &&_HC = "Yes" &&orders[_Order Ranking] = 1 ,"REDEEMER" ,"")
and_____Redeemer 2 =VAR CustomerID = orders[customer_id]VAR _HC = orders[with HC]RETURNIF( CustomerID = orders[customer_id] &&_HC = "Yes" &&orders[_Order Ranking] = 2 ,"REDEEMER" ,"")
What I am trying to achieve here is:
1. Identify which order the customer sent an HC bag- in the first or second order.
2. Then, marked the unique customer REDEEMER1, REDEEMER2, NON-REDEEMER
REDEEMER1 is if he/she submitted an HCbag in the first order or REDEEMER1
REDEEMER2 is if he/she submitted an HCBag in the second order but no HC bag in the first order.
Lastly, if no HC bag in both the first or second order, Tag him as "NON-REDEEMER".
Ultimately, I need to create a stacked column chart where my x-axis is the order ranking, the y-axis is the distinct count of customer_id, having a legend REDEEMER1, REDEEMER2, and NON-REDEEMER. In the chart, REDEEMER2 should only appear from order_rank 2 onwards, there shouldn't be any REDEEMER2 in Order rank 1.
For some reason, I cannot add the pbix file here.
- Andrew_na_lang
Helper V
lbendlin here is the link on google sheets - https://docs.google.com/spreadsheets/d/13smuzNornBBnk2-_utR1WdJjLzZBlvWvRjYxJqoFwiw/edit#gid=1387572587
- lbendlin
Super User
access is denied - please check.
- Andrew_na_lang
Helper V
lbendlin you may now access