Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
SebaG
Frequent Visitor

calculate number of orders/volume/sales based on different shipping location and order reference nr

HI All

Hope someone can help with bellow excersice, as I'm struglling with it and no result.

So... orders can be shipped from 2 different warehouse location: Italy or France. Sometimes it is only France, sometimes it is only Italy, but sometimes order is split and deliver from both location. 

 

Need to know number of orders, their volume and value by index: FR for France, IT for Italy, FR&IT for France & Italy.

In bellow sample dataset I have order split: FR=1; IT=1; FR&IT = 2

 

Thanks in advance.

 

DateOrder Ref NumberItemQuantityItem priceCurrencyWarehouse Location
2019.06.0500000005a41.5DOLItaly
2019.06.0500000005b51.65DOLItaly
2019.06.0500000005c61.32DOLItaly
2019.06.0500000005d771.6DOLItaly
2019.06.05Big Ordera1031.5EURItaly
2019.06.05Big Orderg4051.23EURItaly
2019.06.05Big Orderh901.22EURItaly
2019.06.05Big Orderb961.69EURFrance
2019.06.06for my dada21.37EURFrance
2019.06.06for my dadb31.26EURFrance
2019.06.06for my dadg41.87EURFrance
2019.06.06for my dadd51EURFrance
2019.06.06for my dadl71EURItaly
2019.06.06for my dado21.36EURItaly
2019.06.06for my dadp31.59EURItaly
2019.06.06for my dadz11.49DOLItaly
2019.06.0612345b231.84DOLFrance
2019.06.0612345l451.22DOLFrance
2019.06.0612345d151.36DOLFrance
2019.06.0612345p41.15DOLFrance
2019.06.0612345z341.91DOLFrance
1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

you actually need a column that would say 'Italy & France', otherwise you cannot put it in rows of the visual (measures can be only used as values)

try this code for a calculated column

Warehouse = 
VAR __Order = 'Table'[Order Ref Number]
VAR __OrderAllRows = FILTER(ALL('Table'),'Table'[Order Ref Number]=__Order)
VAR __UniqueWarehouses = SUMMARIZE(__OrderAllRows,'Table'[Warehouse Location])
RETURN
CONCATENATEX(__UniqueWarehouses, 'Table'[Warehouse Location], "&")


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

2 REPLIES 2
Stachu
Community Champion
Community Champion

you actually need a column that would say 'Italy & France', otherwise you cannot put it in rows of the visual (measures can be only used as values)

try this code for a calculated column

Warehouse = 
VAR __Order = 'Table'[Order Ref Number]
VAR __OrderAllRows = FILTER(ALL('Table'),'Table'[Order Ref Number]=__Order)
VAR __UniqueWarehouses = SUMMARIZE(__OrderAllRows,'Table'[Warehouse Location])
RETURN
CONCATENATEX(__UniqueWarehouses, 'Table'[Warehouse Location], "&")


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

SebaG
Frequent Visitor

Thank you Stachu, that helped a lot. Job done thanks to you.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.