Forum Discussion

lotus22's avatar
lotus22
Helper III
6 years ago
Solved

Add custom column with Lookup on the same table

Customer Part Supplier Part Line Type Totals Expected           CPart A   Customer Demand 12345 Empty CPart A SPartY Supplier Order 56 12345 CPart D SPartX Supplier O...
  • v-easonf-msft's avatar
    v-easonf-msft
    6 years ago

    Hi, lotus22 

    "Type 2"  is a calculated column ,so it cannot be found in Power Query.

    You can try create a calculated column as below:

    Column = 
    var a=CALCULATE(SUM('Table'[Totals]),ALLEXCEPT('Table','Table'[Customer Part]),'Table'[Type]="Customer Demand")
    return  IF('Table'[Type]="Customer Demand",BLANK(),a)

     

     pbix attached

     

    Best Regards,
    Community Support Team _ Eason
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.