Forum Discussion

davidibi4524's avatar
davidibi4524
Frequent Visitor
5 years ago

need help

hi everyone

I need to look for the same part name according to the order date between the order date and + 3 days more spare

for exaple: the first line on the order table with part name A-123 maching to the first line on the invoice table because the date is in the range of 13/08/2021 + 3 (between 13/08/2021 and 16/08/2021)

can someone help me find the right dax formula to build the desired table?

thanks :))

 

 

6 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    davidibi4524 Maybe:

    Measure = 
      VAR __PartName = MAX('ORDERS'[part name])
      VAR __MinDate = MAX('ORDERS'[date])
      VAR __MaxDate = __MinDate + 3
      VAR __Table = FILTER('INVOICES',[part name]=__PartName && [date] >= __MinDate && [date]<=__MaxDate)
    RETURN
      SUMX(__Table,[quantity])
  • Hi,

    I suggest that you write a calculated column formula in the Orders table.  Are you interested in that solution (instead of a measure)?

  • Hi,  davidibi4524 

     

    Why does A-456 match the invoice quantity of 2000, and isn't the part name of the invoice quantity of 2000

    A-123? Am I missing something?

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng