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

Creating a new Column to show both Positive and negative values

Hi,

I would like to know if there is a way I can create a column and assign both positives and negative values based on another Column.

here is a hypothetical there is a column laballed DRCRcode and another labelled Amount. I would like to create  another column that will reference DRCRcode and return a positive or negative into the new column.

I tried this formula but it's not getting the job done 

AMOUNT_ = IF(TRNX_DETAILS_20_FACT[DRCRCODE]="C",TRNX_DETAILS_20_FACT[AMOUNT]*-1,TRNX_DETAILS_20_FACT[AMOUNT])
1 ACCEPTED SOLUTION
harshnathani
Community Champion
Community Champion

HI @Anonymous ,

 

I do not see any error in your formula. Are you creating a Calculated Column or a Measure. Please click on New Column.

 

Mine works fine

 

1.jpg

 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @Anonymous,

Your formulas is a calculated column, please double check you are use it in 'calculated column' expressions and the fields it invoked are numeric types that can be calculated with math operators.

In addition, what connection mode are you work with? AFAIK, direct query mode has limited the DAX function usage in calculated column expression.
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
harshnathani
Community Champion
Community Champion

HI @Anonymous ,

 

I do not see any error in your formula. Are you creating a Calculated Column or a Measure. Please click on New Column.

 

Mine works fine

 

1.jpg

 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

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.