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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Oros
Post Prodigy
Post Prodigy

Conditional formula

Hello,

 

What would be the correct measure or custom column to get the correct TOTAL BOXES SOLD in reference to the SOLD BY.

 

For example, if SOLD BY= PIECE, then TOTAL BOXES SOLD=SOLD QTY/PIECES PER BOX, otherwise TOTAL BOXES SOLD.

 

Oros_1-1689089512618.png

 

Thanks.

1 ACCEPTED SOLUTION
Arul
Super User
Super User

@Oros ,

I am not sure whether I have understand your requirement right but this what I have come up with in a calculated column,

 

New Column = IF(TableName[SOLD BY] = "PIECE",TableName[SOLD QTY (BOX OR PIECE)]/TableName[PIECES PER BOX],TableName[TOTAL BOXES SOLD])

 

Thanks,

Arul

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


View solution in original post

6 REPLIES 6
DataVitalizer
Solution Sage
Solution Sage

Hi @Oros 
You can create a calculated column with the following formula

TOTAL BOXES SOLD = if(SOLD BY= "PIECE", SOLD QTY/PIECES PER BOX,SOLD QTY)


Did it work ? 👌 Mark it as a solution to help spreading knowledge 👉 A kudos would be appreciated

Hello @DataVitalizer ,

 

Thank you for your quick reply.  I tried the formula but gave me this error:

Oros_0-1689091136889.png

Can you make sure that your columns are decimal? just to check if there is a text value " in one of your rows instead of numeric values

Arul
Super User
Super User

@Oros ,

I am not sure whether I have understand your requirement right but this what I have come up with in a calculated column,

 

New Column = IF(TableName[SOLD BY] = "PIECE",TableName[SOLD QTY (BOX OR PIECE)]/TableName[PIECES PER BOX],TableName[TOTAL BOXES SOLD])

 

Thanks,

Arul

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


Hello @Arul ,

 

Thank you for your quick reply.  I tried the formula but gave me this error:

Oros_0-1689091136889.png

 

@Oros ,

I think columns used in this columns are text data type. Can you change the data type to whole number and try?

Thanks,

Arul





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors