Forum Discussion
Group Customer by Order type
- Anonymous1 year ago
Hi TanzilHasan,
Thanks for reaching out Microsoft fabric community forum.
As per your query, follow the below steps to achieve you goal.I used the above data. I imported data into power query editor and in transform data i have done group by customer id and order type.
A separate table is created for each customer
Add custom column .use the below code in formula bar
Text.Combine(List.Distinct([Order Types][Order Type]), ", ")
Add another custom column by using the below code in formula bar:
if Text.Contains([Custom], "Paid") and Text.Contains([Custom], "Free") and Text.Contains([Custom], "Mixed") then "All Three"
else if Text.Contains([Custom], "Paid") and Text.Contains([Custom], "Free") then "Free and Paid"
else if Text.Contains([Custom], "Paid") and Text.Contains([Custom], "Mixed") then "Paid and Mixed"
else if Text.Contains([Custom], "Paid") then "Only Paid"
else if Text.Contains([Custom], "Free") then "Only Free"
else "Other"If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you
Hi TanzilHasan,
Thanks for reaching out Microsoft fabric community forum.
As per your query, follow the below steps to achieve you goal.
I used the above data. I imported data into power query editor and in transform data i have done group by customer id and order type.
A separate table is created for each customer
Add custom column .use the below code in formula bar
Text.Combine(List.Distinct([Order Types][Order Type]), ", ")
Add another custom column by using the below code in formula bar:
if Text.Contains([Custom], "Paid") and Text.Contains([Custom], "Free") and Text.Contains([Custom], "Mixed") then "All Three"
else if Text.Contains([Custom], "Paid") and Text.Contains([Custom], "Free") then "Free and Paid"
else if Text.Contains([Custom], "Paid") and Text.Contains([Custom], "Mixed") then "Paid and Mixed"
else if Text.Contains([Custom], "Paid") then "Only Paid"
else if Text.Contains([Custom], "Free") then "Only Free"
else "Other"
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you
Thank you so much, this solution works.