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! Learn more

Reply
Anonymous
Not applicable

Calculated column giving incorrect values

Hi All,

I am stuck in writing a DAX using if else. 

I created a calculated column as below :

POS3002_1-1619716051863.png

The expected result from the above calculation is -45159.04 which is the value for Balance Available_Var2 but I get -10512. (Not sure how I get this value). Please see below 

 

POS3002_0-1619716027687.png

These are the two fields:

POS3002_2-1619716141261.png

 

Can some one please let me know where I am going wrong?

 

Thanks

Poojitha

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous 

 

It's not so much about changing the model but more about how context transition in this case works. To know what your measure will calculate when used in a column, you have to understand exactly how it'll interact with the row context. Also, you should avoid creating a calculated column in a fact table like the plague. Such a need can be efficiently and correctly addressed in Power Query.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

A measure used in a calculated column does context transition, so you have to figure out how this context is propagated throughout the model to be able to explain the figure you get.

Anonymous
Not applicable

I tried createing a measure by skightly changing the model and I still get incorrect result

Anonymous
Not applicable

@Anonymous 

 

It's not so much about changing the model but more about how context transition in this case works. To know what your measure will calculate when used in a column, you have to understand exactly how it'll interact with the row context. Also, you should avoid creating a calculated column in a fact table like the plague. Such a need can be efficiently and correctly addressed in Power Query.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.