Forum Discussion
blazer12219
6 years agoFrequent Visitor
DAX IF Statement formula in added Column
Accounting SQL database accessing does recognize Credit Memos as negatives so when add total Taxable Sales the total is wrong. Attempting to add new Column to Database that looks at TrxType 2 whi...
edhans
6 years agoCommunity Champion
You are better off doing this in Power Query. I suspect your TrxType isn't an integer is why DAX is failing, but you can clearly see the data type in Power Query. Assuming it is an integer, you'd use this:
if [TrxType] = 2 then -[TaxableAmt] else [TaxableAmt]
If it is a string, then use this
if [TrxType] = "2" then -[TaxableAmt] else [TaxableAmt]
Then get rid of the original TaxableAmt column, and rename the new custom column TaxableAmt, make sure it is typed as a number, integer, or currency (number with 4 decimal places) to suit your needs, then close and load.