Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have a column for UOM_LENGTH, UOM_WIDTH, UOM_HEIGHT with a large set of data, I want to see what box size each item would ship in, with the below table showing the available sizes. My goal is the product would ship in the box based on the measurements. The length, width, and height do not correlate so since it's user inputted. I wanted to add a new column to the dataset that will tell me the box size with the letter. Any help would be greatly appreciated.
Box Sizes ( all in pallet counts) Box Type
9.5x6.5x3 - F
15 X 10 X 4 - G
8x8x4 - H
12x8x4 - I
12x8x8 - J
19x14x4 - L
19x14x8 - N
19x14x12 - P
24 X 14 X 4 - U
24x16x16 - S
Solved! Go to Solution.
@ehrreich21 - Eh, got bored, just went ahead and did it:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Box-Sizes/td-p/1356883
That DAX attempt without testing from memory was trash anyway.
@ehrreich21 - I solved this once before, which I could find that formula, I believe you will need height, width and length in separate columns along with box size. You would then want a Volume calculated column like this:
Volume (Column) = [Height] * [Width] * [Length]
Then you need to do this.
Box Size (Column) =
VAR __UserMeasure1 = MINX( {[userheight],[userwidth],[userlength]},[Value])
VAR __UserMeasure2 = MINX( EXCEPT({[userheight],[userwidth],[userlength]},{__Measure1}),[Value])
VAR __UserMeasure3 = MINX( EXCEPT({[userheight],[userwidth],[userlength]},{__Measure1, __Measure2}),[Value])
VAR __BoxTable =
ADDCOLUMNS(
ADDCOLUMNS(
ADDCOLUMNS(
'Box Sizes',
"__Measure1"=MINX( {[Height],[Width],[Length]},[Value]),
),
"__Measure2"=MINX( EXCEPT({[Height],[Width],[Length]},{[__Measure1]}),[Value]),
),
"__Measure3"=MINX( EXCEPT({[Height],[Width],[Length]},{[__Measure1],[__Measure2]}),[Value])
)
VAR __Table =
FILTER(
ADDCOLUMNS(
__BoxTable,
"Fit1",IF(__UserMeasure1<[__Measure1],1,0),
"Fit2",IF(__UserMeasure2<[__Measure2],1,0),
"Fit3",IF(__UserMeasure3<[__Measure3],1,0)
),
[Fit1]=1 && [Fit2]=1 && [Fit3]=1
)
VAR __MinBoxVolume = MINX(__Table,[Volume])
RETURN
MAXX(FILTER(__Table,[Volume]=__MinBoxVolume),[Size])
Not sure I follow, I currently have these columns now in my table. I would like it to add a column of the correct box size to use as the new column
@ehrreich21 - Eh, got bored, just went ahead and did it:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Box-Sizes/td-p/1356883
That DAX attempt without testing from memory was trash anyway.
@ehrreich21 - Paste that data as text in a table and I'll write up a specific implementation for you. Are you showing user transactions table there? I will need that. You will also want a table with your box sizes broken out into height, width and length. I hate typing data. Please make sure to @ me in response otherwise I'll probably lose the thread.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
74 | |
73 | |
56 | |
38 | |
31 |
User | Count |
---|---|
84 | |
63 | |
63 | |
49 | |
45 |