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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.