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

Trying to add a calculated column into a table

Hello,

Sorry if this is a very simple question, but hope somebody can help me.

 

I'm trying to add a new calculated column in a table to calculate 'Total Cost Of sales'. The formula I have is:

 

= ["Quantity_Ordered]  * [Standard_Cost_Per_Case]

 

The formula is accepted but every line calculates to 0

 

What am I doing wrong? I'm new to Power BI and am basically an excel user. It the syntax of the formula wrong?

 

Hope somebody can help?

 

Thanks

 

Pete

1 ACCEPTED SOLUTION

Thanks Johanno.

 

My fault!

I think the problem is not BI related but the raw data source.....One of the columns has not been populated yet for September, so is appearing as 0. Obviusly anything multiplied by zero = zero!!!!

 

 

Pete

View solution in original post

4 REPLIES 4
Johanno
Responsive Resident
Responsive Resident

It should work for both when it's in the same table, but I think best practise is to also specify the table names in the formulas and not only the column name e.g. Total=TableName[Quantity_Ordered]*TableName[Standard_Cost_Per_Case] 

Also, I note that you have a " before Quantity if that has something to do with it.

 

Thanks Johanno.

 

My fault!

I think the problem is not BI related but the raw data source.....One of the columns has not been populated yet for September, so is appearing as 0. Obviusly anything multiplied by zero = zero!!!!

 

 

Pete

It’s hard to say why you are getting zeros, but have a look at my article here. 

 

https://exceleratorbi.com.au/calculated-columns-vs-measures-dax/

 

There is a lot of beginners info here https://exceleratorbi.com.au/knowledge-base/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

Thanks Matt

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.