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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
JackEnviro
Helper I
Helper I

Infinity issue with DIVIDE multiply and subtract

Hi All 

 

The formula below works but with an infinity issue

 

Sales Total (Net) = SUMX('Invoices',('Invoices'[LineItem_UnitAmount]*'Invoices'[LineItem_Quantity] - 'Invoices'[CreditAmount] )/Invoices[LineItem_TaxAmount])

 

I have tried converting to a DIVIDE but can't seem to get it to work. 

 

Any suggestions much apprecated 

 

Thanks 

Jack 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @JackEnviro ,

 

Have you tried the following code:

 

ttt =
SUMX (
    'Invoices',
    DIVIDE (
        ( 'Invoices'[LineItem_UnitAmount] * 'Invoices'[LineItem_Quantity] - 'Invoices'[CreditAmount] ),
        Invoices[LineItem_TaxAmount]
    )
)

If this doesn't work can you share some sample information and expected result?

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @JackEnviro ,

 

Have you tried the following code:

 

ttt =
SUMX (
    'Invoices',
    DIVIDE (
        ( 'Invoices'[LineItem_UnitAmount] * 'Invoices'[LineItem_Quantity] - 'Invoices'[CreditAmount] ),
        Invoices[LineItem_TaxAmount]
    )
)

If this doesn't work can you share some sample information and expected result?

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi felix 

 

Sorry thought that solved it but it, is not working but result 36 is not what is expected, should be £1957.34, or close to

 

Result.JPG

The underlying table for that invoice look like this:

 

LineItem_QuantityLineItem_UnitAmountLineItem_ItemCodeLineItem_TaxAmountLineItem_LineAmountInvoiceNumberSubTotalTotalTaxTotalAmountPaidAmountCreditedTax%CreditAmount            
4627.36D-H-S-4209.761258.56EB132691957.34392.052349.392349.3901.20            
1812.39DA-SP-1072.4432.59EB132691957.34392.052349.392349.3901.20            
520.99DA-TC-B17.5104.95EB132691957.34392.052349.392349.3901.20            
3518.57DA-J-P-50108.5649.95EB132691957.34392.052349.392349.3901.20            
1-123.65 -20.61-123.65EB132691957.34392.052349.392349.3901.20            
126.99DA-LC-B4.526.99EB132691957.34392.052349.392349.3901.2LineItem_QuantityLineItem_UnitAmountLineItem_ItemCodeLineItem_TaxAmountLineItem_LineAmountInvoiceNumberSubTotalTotalTaxTotalAmountPaidAmountCreditedTax%CreditAmount
            4627.36D-H-S-4209.761258.56EB132691957.34392.052349.392349.3901.20
            1812.39DA-SP-1072.4432.59EB132691957.34392.052349.392349.3901.20
            520.99DA-TC-B17.5104.95EB132691957.34392.052349.392349.3901.20
            3518.57DA-J-P-50108.5649.95EB132691957.34392.052349.392349.3901.20
            1-123.65 -20.61-123.65EB132691957.34392.052349.392349.3901.20
            126.99DA-LC-B4.526.99EB132691957.34392.052349.392349.3901.20

 

Thank

Jack 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.