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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Jkiddin
New Member

Power BI creating a formula in a custom column

I've never worked with Power BI before but i assumed the formulas were similar to Excel but it isn't? I don't know how to create a formula that uses an if statement to calculate a value. What i have right now is: 

IF [Discount] > 0 then value.Multiply([UnitPrice], [Discount]) else 0

but it says the value.multiply is wrong so i don't know if there should be commas or something to separate it since the formula requirements don't pop up as i type. After calculating whether the discount price should be multiplied, i wanted to subtract that price from the value.multiply([UnitPrice], [Quantity]) to get total revenue, but i DON'T know how to even combine these formulas into one long formula like excel does. do i start a new column? a new equal sign underneath? 

Jkiddin_0-1635739095982.png

 

1 ACCEPTED SOLUTION

@Jkiddin 

You have typed "IF" with upper case, Power Query is case sensitive, it should be all lower case here. type it as follows:


 

if [Discount] > 0 then ( [UnitPrice] * [Discount] )  else 0

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Jkiddin , Try like

 

if [Discount] > 0 then [UnitPrice]* [Discount]  else 0

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

it still didn't work 😞 

Jkiddin_0-1635740040276.png

 

@Jkiddin 

You have typed "IF" with upper case, Power Query is case sensitive, it should be all lower case here. type it as follows:


 

if [Discount] > 0 then ( [UnitPrice] * [Discount] )  else 0

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.