Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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 which is a credit memo than multiples that total by -1.0 to turn it to a negative that if anything else it just returns the TaxableAmt for that row so when added all together the total is correct.
When attempting formula just will not calculate properly
IF [TrxType] = 2 then ([TaxableAmt]*-1) else ([TaxableAmt])) also tried
IF([TrxType]=2,([TaxableAmt]*-1),([TaxableAmt]))
any help appreciated,
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.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI Reporting