Forum Discussion

Maahmohammed's avatar
Maahmohammed
Icon for Helper I rankHelper I
2 years ago
Solved

How to udentify invoice No. that doesn't include a specific product?

Dears,

I have some orders, some of them are charged with delivery charge & others are free. We add the delivery charge as an item with a code No. (11), so in case the order is charged with delivery, we add item No. (11) & in case it's free of charge, we don't add that item.

I'd like to have 2 separate tables as per the below:

Data tables

The expected outcome tables are:

 

 

 

  • You can write a measure to sum the total price

     

    Total Invoice Cost = SUM ( YourTable[Price] )

     

    Then a mesure to calculate the delivery cost.

     

    Delivery Cost = CALCULATE ( [Total Invoice Cost], YourTable[Procuct_ID] = "11" )

     

    Put those field in the table with the invoice numbers and set the first one to [Delivery Cost] is not blank and the second to [Delivery Cost] is blank

     

     

1 Reply

  • You can write a measure to sum the total price

     

    Total Invoice Cost = SUM ( YourTable[Price] )

     

    Then a mesure to calculate the delivery cost.

     

    Delivery Cost = CALCULATE ( [Total Invoice Cost], YourTable[Procuct_ID] = "11" )

     

    Put those field in the table with the invoice numbers and set the first one to [Delivery Cost] is not blank and the second to [Delivery Cost] is blank