Forum Discussion

NotVeryGoodatBI's avatar
NotVeryGoodatBI
Frequent Visitor
2 years ago
Solved

Need Help With LOOKUPVALUE or need ideas

Hello, I am a little new to PowerBI and I am trying find a function like Excel's VLOOKUP that will allow me to create a column in Invoice Table 1 that pulls correct margin value from the time frame o...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi NotVeryGoodatBI ,

    Please try the following methods and check if they can solve your problem:

    1.Create a new column. Enter the following DAX formula.

    Margin_table(Margin) = 
    CALCULATE(SUM('Margin_Table'[Margin]),
    FILTER('Margin_Table',
    'Margin_Table'[ID]='Invoice_Table'[ID]&&'Margin_Table'[start_date]<='Invoice_Table'[start_date]&&'Margin_Table'[end_date]>='Invoice_Table'[start_date]))

     

    2.Drag the new column to the Invoice_Table.

    3.The result is shown below.

     

    Best Regards,

    Wisdom Wu