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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
selpaqm
Helper V
Helper V

distrubution of senders to the specific place

Hi,

 

I have a table as below. 

storebox weightdestination
aaaa80xxxx
aaaa60yyyy
bbbb10xxxx
bbbb60yyyy
cccc100xxxx
cccc50xxxx

I want to find out how many boxes will be reach to destination related with stores.

all my boxes total weight can be 40kg. that means for aaaa for destination xxxx is 2 (80/40=2). 

for destination xxxxx

from store aaaa 2 boxes, from store bbbb 0.25 = 1 (all shoulde be rounded up) box and from cccc 3.75=4 boxes totally 2+1+4=7 boxes. 

in case of sum of directly weights and divide to 40 will give different numbers

80+10+150=240/40=6 

 

so how can we calculate it?

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You can use

Num boxes = 
VAR MaxBoxWeight = 40
VAR SummaryTable = ADDCOLUMNS(
	SUMMARIZE( 'Table', 'Table'[destination], 'Table'[store]),
	"@total weight", CALCULATE( SUM( 'Table'[box weight]))
)
VAR NumBoxes = SUMX(
	SummaryTable,
	CEILING( DIVIDE( [@total weight], MaxBoxWeight), 1)
)
RETURN NumBoxes

View solution in original post

2 REPLIES 2
Tahreem24
Super User
Super User

@selpaqm Try this:

Box Result =
VAR Box_ = SUM(StoreTable[box weight])/40
 Return CEILING(Box_,1)
Tahreem24_0-1683026964397.png

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
johnt75
Super User
Super User

You can use

Num boxes = 
VAR MaxBoxWeight = 40
VAR SummaryTable = ADDCOLUMNS(
	SUMMARIZE( 'Table', 'Table'[destination], 'Table'[store]),
	"@total weight", CALCULATE( SUM( 'Table'[box weight]))
)
VAR NumBoxes = SUMX(
	SummaryTable,
	CEILING( DIVIDE( [@total weight], MaxBoxWeight), 1)
)
RETURN NumBoxes

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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