cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gauravsukhadia
Frequent Visitor

Calculated Column ( Order of Calculation trouble )

Hi Team,

 

I have unique problem where Power BI Calculated column returns wrong result and not as per formula. 

 

Second Part of My formula is trying to say give me weight of each product if product profile matches "Angle" then (edge_width*2-thickness)*thickness*length*0.0075*quanity. If I calculate manually then 50mmx50mmx4mm Angle = 6 MTR weight should come as 18.0864 Kg but Power BI gives 99.2464 kg. I have no idea why? Possibly due to order of calulation is going wrong ? 

 

Formula : 

weight = if(OR('Transactions_2020-21'[Profile]="Universal Beam",'Transactions_2020-21'[Profile]="Universal Column"),'Transactions_2020-21'[edge_width2]*'Transactions_2020-21'[Length]*'Transactions_2020-21'[Quantity], IF('Transactions_2020-21'[Profile]="Angle", 'Transactions_2020-21'[edge_width1]*2-'Transactions_2020-21'[thickness]*'Transactions_2020-21'[thickness]*'Transactions_2020-21'[Length]*0.00785*'Transactions_2020-21'[Quantity],0))
 
Please help. Thanks 

 

 

1 ACCEPTED SOLUTION
sktneer
Resolver I
Resolver I

In the actual formula, you are missing parenthesis as used in your following manual calculation so the order of calculation would be different.

(edge_width*2-thickness)*thickness*length*0.0075*quanity

View solution in original post

5 REPLIES 5
sktneer
Resolver I
Resolver I

In the actual formula, you are missing parenthesis as used in your following manual calculation so the order of calculation would be different.

(edge_width*2-thickness)*thickness*length*0.0075*quanity

View solution in original post

Sorry, my bad I wasn't putting both parenthesis so it was showing the wrong result. You are the man, your solution worked. 

use DAX Formatter , just paste your code, it will format and inform where you are missing parenthesis.

happy learning 🙂

But if I put parenthesis then If the formula assumes calculation is over and state the next parameter you know what I mean. 

gauravsukhadia
Frequent Visitor

gauravsukhadia_0-1624073256070.png

 

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.