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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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