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
Anonymous
Not applicable

Multiply column by a value if another column equals specified value

I am still fairly new to Power BI and DAX.  I need to multiply a column by a specified value if another column equals a specified value.  

 

So using the photo below for reference, I need to:

 

Multiply whatever is in quantity remaining by a certain value depending on what Part Number equals.  For example:

 

Multiply Quantity Remaining by 5 if Part Number = "U4INSTRAP"

 

 

Capture.JPG

 

2 REPLIES 2
jdbuchanan71
Super User
Super User

How many conditions will you have?  Doing it off [Part Number] makes me think you will have a lot so you would be better off having a table with each [Part Number] once and a column for the multiplier then joining that to your fact table (the one in the picture) and doing a measure like 

Amount = SUMX ( fact, fact[Quantity Remaining] * RELATED ( lookup, lookup[Multiplier] ) )

 

Anonymous
Not applicable

Thank you for the reply.  I actually only have about 15 in this case so I answered my own question.  I just used a nested if statement to hit the values I wanted.  

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.