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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
JLCote828
Frequent Visitor

New Calculated Column

Hi All -

 

I'm struggling to create a calculated column using values from another.  It can't be that difficult but I don't know why it's not coming to me!!!
Essentially, if the "Transaction Code Description" = "XXXXX", then multiply by -1, otherwise, keep the original value.

Transaction Code DescriptionAmountNEW COLUMN
Issue $       25 $                     25
Merch Credit $       25 $                     25
PIN Redeem $       75 $                    (75)
Redeem $     100 $                  (100)
Cancel $       75 $                    (75)
Pre-auth Completion $       25 $                     25
Reversal $       50 $                    (50)
Keyed Issue $     100 $                    100
Keyed Merch Credit $       75 $                     75
OSI Db Adjust $       15 $                    (15)
PIN Issue $       25 $                     25
PIN Pre-auth Completion $       50 $                     50
Mass Valuation $   1,000 $                 1,000
OSI Redeem $     100 $                  (100)
OSI Cr Adjust $       75 $                     75
OSI Issue $       50 $                     50
Deactivation $     100 $                  (100)
PIN Cash Out $       75 $                    (75)
Issue Virtual $     200 $                    200
Mass Devaluation $   2,000 $               (2,000)
Keyed Cash Out $     200 $                  (200)
OSI Merch Credit $     100 $                    100
Keyed Redeem $       75 $                    (75)
  $   4,615 $                (1,115)


Any help would be greatly appreciated.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @JLCote828 ,
Thank you for the prompt response @vicky_ and @ajaybabuinturi !

I try with following query:

NEW COLUMN =
VAR ReversalCodes = {
    "PIN Redeem", "Redeem", "Cancel", "Reversal",
    "OSI Db Adjust", "OSI Redeem", "Deactivation",
    "PIN Cash Out", "Mass Devaluation", "Keyed Cash Out",
    "Keyed Redeem"
}
RETURN
IF(
    'Table'[Transaction Code Description] IN ReversalCodes,
    'Table'[Amount] * -1,
    'Table'[Amount]
)

Refer the attached file.
If this solution meets your requirements, please consider marking it as the accepted solution.

Thank you for being a valued member in Microsoft Fabric Community Forum!
Regards,
Pallavi.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @JLCote828 ,
Thank you for the prompt response @vicky_ and @ajaybabuinturi !

I try with following query:

NEW COLUMN =
VAR ReversalCodes = {
    "PIN Redeem", "Redeem", "Cancel", "Reversal",
    "OSI Db Adjust", "OSI Redeem", "Deactivation",
    "PIN Cash Out", "Mass Devaluation", "Keyed Cash Out",
    "Keyed Redeem"
}
RETURN
IF(
    'Table'[Transaction Code Description] IN ReversalCodes,
    'Table'[Amount] * -1,
    'Table'[Amount]
)

Refer the attached file.
If this solution meets your requirements, please consider marking it as the accepted solution.

Thank you for being a valued member in Microsoft Fabric Community Forum!
Regards,
Pallavi.

I figured I'd start with the first suggestion and work my way down ... no need, this worked on the first try!  I can't thank you enough!  You're making me look smart!
Thank you too @ajaybabuinturi and @vicky_  as well!!!

Thank you, @Anonymous , @ajaybabuinturi , and @vicky_ , I SO much appreciate the assist!  I'll give these a try and keep you posted!

ajaybabuinturi
Resident Rockstar
Resident Rockstar

Hi @JLCote828 ,

You can try with 

Column Name = IF('Table'[Transaction Code Description] = "XXXX", 'Table'[Amount] * -1, 'Table'[Amount])

 

If you want to give multiple description suse @vicky_ code.

 

Thanks, 

If the solution helps you please mark it as Accepted Solution and give kudos 👍. So that others can easily found the solution.

vicky_
Super User
Super User

You could try something like the below:

New Column = IF(Table[Transaction Code] in {"Your", "Codes", "Here"}, Table[Amt] * -1, Table[Amt])  

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.