Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
My tasks if to calculate total customers into groups based on the total orders they made.
For example:
Total customers who made from 1 to 5 orders.
Total customers who made from 6 to 10 orders.
Total customers who made from 11+ orders.
What is the formula to group these 3 customers segmentation like this?
In this case, I use the sample_superstore.
Hope you could help me! Thanks so much
I made this customers segment in Tableau, but I dont know how to make it in Power Bi. This is the way I made in Tableau.
1. Calculate Orders 1 - 5
2. Caculate number of Total Customers who made 1-5 orders.
Thanks for reading! and hope to hear from you!!
Solved! Go to Solution.
Hi again @Anonymous
I updated my PBIX with the same dataset you have used in your Tableau workbook.
My existing measure is actually sufficient to do what you want.
I created the same visual you had in Tableau:
Date of First Purchase = CALCULATE ( MIN ( Orders[Order Date] ), ALLEXCEPT ( Orders, Orders[Customer ID] ) )Note that I hid this column in Report View
Months Since First Purchase = VAR MonthIndex = DATEDIFF ( Orders[Date of First Purchase], Orders[Order Date], MONTH ) RETURN "M" & FORMAT ( MonthIndex, "00" )
You could also create measures that apply particular segment filters, such as
Number Customer Purchase 1 to 5 = CALCULATE ( [Number of Customers by Order Count Segment], Segment[Segment Name] = "1 to 5" )
PBIX attached. Please post back if needed.
Regards,
Owen
Note that when including both Months Since First Purchase and First Purchase Month on the visual , all customers have five or fewer orders.
Hi,
Check my reply dates July 6. There is a download link there.
Whom are you replying to?
Thank you for helping me to solve the problem!!
Really appricated!!
Hi @Anonymous
In this situation, with Power BI you would typically use a Dynamic Segmentation pattern
(see here).
I have attached a sample PBIX using a version of the Superstore data.
The steps are:
Number of Customers by Order Count Segement = IF ( ISFILTERED ( Segment[Segment Name] ), COUNTROWS ( FILTER ( VALUES ( Orders[Customer ID] ), VAR OrderCount = CALCULATE ( DISTINCTCOUNT ( Orders[Order ID] ) ) RETURN COUNTROWS ( FILTER ( Segment, ( OrderCount >= Segment[Min Value] || ISBLANK ( Segment[Min Value] ) ) && ( OrderCount <= Segment[Max Value] || ISBLANK ( Segment[Max Value] ) ) ) ) > 0 ) ), DISTINCTCOUNT ( Orders[Customer ID] ) )
This measure will naturally respond to any other filters applied.
Regards,
Owen
Your solution @OwenAuger is excllent but have one small problem, when you clcik on the segment it doesn't give the number of orders for each segment , please look at the screen-shot below:
For Example if I click on 1 to 5 Segment the card doesn't give the total no of order of this particuler segment (gives the total orders in all segments) , please advise.
If you place the same "segmented" measure on the card as is used on the other visual, you should see the segmented value there as well.
Does that work in your case?
Dear,
Thank you for your solution.
Could you please to spend time to make the customer segmentation into separated group?
Like I did in Tableau, I calculated total number of different group of customer who made orders from 1-5, 6-10, 10+
In this case, you dont need to separate into B2B or C2C. just number of customer from each orders segmentation.
I would use this to build cohort analysis like this:
Thanks for help!!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
100 | |
78 | |
76 | |
52 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |