Forum Discussion
Anonymous
7 years agoNot applicable
group customer by orders
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 o...
- 7 years ago
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:
- Created First Purchase Date calculated column in Orders and related this to a First Purchase Date table:
Date of First Purchase = CALCULATE ( MIN ( Orders[Order Date] ), ALLEXCEPT ( Orders, Orders[Customer ID] ) )Note that I hid this column in Report View - Created Monts Since First Purchase calculated columns:
Months Since First Purchase = VAR MonthIndex = DATEDIFF ( Orders[Date of First Purchase], Orders[Order Date], MONTH ) RETURN "M" & FORMAT ( MonthIndex, "00" ) - Applied a Page Level Filter, Segment Name = "1 to 5"
- Placed my earlier measure Number of Customers by Order Count Segment in a matrix visual, with some conditional formatting similar to your Tableau example.
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.
- Created First Purchase Date calculated column in Orders and related this to a First Purchase Date table:
OwenAuger
Super User
5 years agoIf 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?
MAAbdullah_47
Helper V
5 years agoHi OwenAuger
I couldn't , could you show me a screen-shot please ?