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.
Hi,
I have a table as below.
store | box weight | destination |
aaaa | 80 | xxxx |
aaaa | 60 | yyyy |
bbbb | 10 | xxxx |
bbbb | 60 | yyyy |
cccc | 100 | xxxx |
cccc | 50 | xxxx |
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?
Solved! Go to Solution.
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
@selpaqm Try this:
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
103 | |
102 | |
87 | |
73 | |
67 |
User | Count |
---|---|
119 | |
111 | |
95 | |
79 | |
72 |