cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jmsm
Helper I
Helper I

Group by the multiple values in one column

Hello. I have a some columns in my file that correspond to customer's orders: order date, payment date, Number of order, product typology, etc.  The behavior of the file is: when some customer order more than 1 item, it creates two lines for the same order, for example:

Num_Order       Orderdate             SKU              typology         

1234                   10/09/2020           123456        23

1234                   10/09/2020           765432         22

 

I want to do a group by by Num_Order so i can identify how many orders are mono orders (1 item) and how many are multi orders (more than 1 item). The problem is that I need to add to this group by the item's typology and customers can order itens from the same typology and different as well. 

 

I need this information for doing an analysis of how many customers did a multi order for all itens typologies except "23", by excluing the order lines that have typology "23" and maintain the rest. 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@jmsm , You can count orders like this

Single Item orders = countx(filter(Summarize(Table,Table[Num_Order], "_1", count(Table[SKU])), [_1]=1),[Num_Order])
multiple Item orders = countx(filter(Summarize(Table,Table[Num_Order], "_1", count(Table[SKU])), [_1]>1),[Num_Order])

 

Two have these as bucket values or dimension value you need have brining or segmentation

https://www.daxpatterns.com/dynamic-segmentation/
https://www.daxpatterns.com/static-segmentation/
https://www.poweredsolutions.co/2020/01/11/dax-vs-power-query-static-segmentation-in-power-bi-dax-po...
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@jmsm , You can count orders like this

Single Item orders = countx(filter(Summarize(Table,Table[Num_Order], "_1", count(Table[SKU])), [_1]=1),[Num_Order])
multiple Item orders = countx(filter(Summarize(Table,Table[Num_Order], "_1", count(Table[SKU])), [_1]>1),[Num_Order])

 

Two have these as bucket values or dimension value you need have brining or segmentation

https://www.daxpatterns.com/dynamic-segmentation/
https://www.daxpatterns.com/static-segmentation/
https://www.poweredsolutions.co/2020/01/11/dax-vs-power-query-static-segmentation-in-power-bi-dax-po...
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

View solution in original post

Greg_Deckler
Super User
Super User

@jmsm Seems like a matrix visualization with multiple columns in the Rows field area?


@ me in replies or I'll lose your thread!!!
Check out my External Tool for Power BI Desktop! Microsoft Hates Greg's Quick Measures
YouTube Channel! Microsoft Hates Greg
Check out my latest book!

It is a matrix with multiple column fields that correspond to order's fields like number of order, payment date, shipment status, Sku number, and SKU typology. 

 

Each row correspond to each order's entry. That means that if a client orders only one item, it corresponds to his order but if a client orders 4 itens, the 4 rows correspond to client's order. 

 

I want to group by by number of order to understand if a customer orders one item or more than one. The problem is that I want to understand which sku typologies clients order and I can't group by different values (a client can order different itens' typologies like socks and a tshirt, that corresponds to different numbers (23 and 45 for example).

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Top Solution Authors
Top Kudoed Authors