Forum Discussion
group customer by orders
- 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 Sorry for once again disturbing you!
I just look at the power bi of Order Count again. The number of Customer of 1-5 change, but for 6-10 and 11+ it is not available in the visual
Maybe it would be my error at some points.
Could you help me please to check it, whether I made error at some points?
Here is the power bi file: https://we.tl/t-LOBm6PdKL3https://we.tl/t-Qk16HJsrPG
Hope to hear from you!!
Thanks!!
Hi Anonymous
Just got to looking at this - not sure what the current status is given the other replies.
The reason you don't see anything in the 6-10 or 11+ segments in that particular visual is that no customers have that many orders for any one value of "months since first purchase".
Did you want the segmentation to ignore the filter on "months since first purchase"? If so, the segmentation measure would need to be re-written to ignore that filter when segmenting a customer.
Also, as far as I can tell the filtering is working. The segmentation will be recalculated based on whatever other filters are applied. Can you give an example of what wasn't working.
Regards,
Owen
- Anonymous7 years agoNot applicable
Dear OwenAuger
Once again, I would like to thank you and sorry for my mistaken.
That's true, there is no customer purchase from 6-10 in 1st purchase, that's why it is not available on dashboard.