Forum Discussion

JLCote828's avatar
JLCote828
Frequent Visitor
1 year ago
Solved

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 D...
  • Anonymous's avatar
    Anonymous
    1 year ago

    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.