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
Ice1341
Helper I
Helper I

Need Dax formula for calculating pallets for each product line

I have a report built with cases for each item/product line, but in order to get pallet quantity, I need to divide by 40 for JUICE category and 80 for frozen ice. Here's the sample, pallet quantity is incorrect.

YearMonthbillToCustomerNumberdescriptionGrSalesOrderAmtNet amountPalletsquantityProd Line
2022JanuaryREPIRSTR0298 Strawberry FJ 90pk MC-90 cups/ 4oz ea432041042160JUICE
2022JanuarySTARCHI0458 Cherrymoji FJ 90pk MC-90 cups/ 4oz ea308443084411880JUICE
2022JanuarySTARMAN0090 Mango FJ 90pk MC-90 cups/ 4oz ea108010800.540JUICE
2022JanuarySTARSTR0298 Strawberry FJ 90pk MC-90 cups/ 4oz ea21602160180JUICE
2022JanuarySTARWAT0182 Watermelon FJ 90pk MC-90 cups/ 4oz ea108010800.540JUICE
2022JanuaryGOR0001MAN0020151015100.540FrozenIce
1 ACCEPTED SOLUTION
AbbasG
Memorable Member
Memorable Member

@Ice1341 Hi, here is my possible solution. Hope it helps.

Steps:

1. I have created a conditional column based on the product line.

IF JUICE then  40 else by 80 (So that it give me the right number to divide by qty)

AbbasG_0-1667095442437.png

2. Then I simply used the divide function to create a calculated column to get the pallets count.

AbbasG_1-1667095481478.png

In case you need to refer to the pbix file, here it is



 

View solution in original post

2 REPLIES 2
YukiK
Impactful Individual
Impactful Individual

Could you create a calculated column with your conditions?

AbbasG
Memorable Member
Memorable Member

@Ice1341 Hi, here is my possible solution. Hope it helps.

Steps:

1. I have created a conditional column based on the product line.

IF JUICE then  40 else by 80 (So that it give me the right number to divide by qty)

AbbasG_0-1667095442437.png

2. Then I simply used the divide function to create a calculated column to get the pallets count.

AbbasG_1-1667095481478.png

In case you need to refer to the pbix file, here it is



 

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.