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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Jidnyasa2904
Helper I
Helper I

Customer occurence with filter

I am trying to understand customer behavior. 
I have given an example below. 
I want to know how many customers first shopped with a 20% off coupon and returned to shop with 10%off or 5%off. 

Answer: 
1 customer returned to the shop with 10%off (customer id: ABC)

1 customer returned to the shop with 5%off (customer id: BCD)

 

Customer ID Order id Amount Coupon
ABC12020%off
BCD21220%off
EFG31220%off
ABC41010%off
BCD5355%off


Also, which visual would be best and easy to understand. 

2 ACCEPTED SOLUTIONS
Kaviraj11
Super User
Super User

Hi,

I think bar chart is ideal in this scenarios because it's easy to compare different categories (in this case, the types of discount coupons) by visually representing the data with bars of varying lengths. Secondly, the visual separation of bars helps in quickly identifying which coupon type had more returning customers. Lastly, the differences in bar lengths immediately highlight the variations in the number of customers for each coupon type.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

Anonymous
Not applicable

Hi Kaviraj11 ,thanks for the quick reply, I'll add more.

Hi @Jidnyasa2904 ,

The Table data is shown below:

vzhouwenmsft_0-1723690607728.png

Use the following DAX expression to create  measures

Total_returning_customers = 
VAR _table = SUMMARIZE('Table',[Customer ID ],"Returning Customers",COUNTROWS('Table'))
RETURN COUNTROWS(FILTER(_table,[Returning Customers] >= 2 ))
which_coupon = 
VAR _coupon = SELECTEDVALUE('Table'[Coupon])
RETURN COUNTROWS(FILTER('Table','Table'[Coupon] <> "20%off" && 'Table'[Coupon] = _coupon))

Final output

vzhouwenmsft_1-1723690678126.png

vzhouwenmsft_2-1723690696486.png

 

Best Regards,
Wenbin Zhou

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Shouldn't there be a Date column there as well?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi Kaviraj11 ,thanks for the quick reply, I'll add more.

Hi @Jidnyasa2904 ,

The Table data is shown below:

vzhouwenmsft_0-1723690607728.png

Use the following DAX expression to create  measures

Total_returning_customers = 
VAR _table = SUMMARIZE('Table',[Customer ID ],"Returning Customers",COUNTROWS('Table'))
RETURN COUNTROWS(FILTER(_table,[Returning Customers] >= 2 ))
which_coupon = 
VAR _coupon = SELECTEDVALUE('Table'[Coupon])
RETURN COUNTROWS(FILTER('Table','Table'[Coupon] <> "20%off" && 'Table'[Coupon] = _coupon))

Final output

vzhouwenmsft_1-1723690678126.png

vzhouwenmsft_2-1723690696486.png

 

Best Regards,
Wenbin Zhou

Jidnyasa2904
Helper I
Helper I

Hi,

Can you also help me with the occurrence calculation? 
I want to know, how customers buy and their patterns.

@Kaviraj11 

Kaviraj11
Super User
Super User

Hi,

I think bar chart is ideal in this scenarios because it's easy to compare different categories (in this case, the types of discount coupons) by visually representing the data with bars of varying lengths. Secondly, the visual separation of bars helps in quickly identifying which coupon type had more returning customers. Lastly, the differences in bar lengths immediately highlight the variations in the number of customers for each coupon type.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.