Forum Discussion

ninakarsa's avatar
ninakarsa
Helper II
6 years ago
Solved

count between dates by product

Hi All, I need a bit of help, trying to solve the following problem. I have 'Table A' with products with start and end dats, i have 'Table B' with sales by product. I want to create a table c as bel...
  • Greg_Deckler's avatar
    6 years ago

    So I did the following. PBIX attached.

     

    Table C = 
      ADDCOLUMNS(
          'Table B',
          "number",COUNTROWS(
              FILTER(
                  'Table A',
                  'Table B'[Product] = 'Table A'[product] && 
                    'Table B'[sales date] >= 'Table A'[start Date] && 
                        'Table B'[sales date] <= 'Table A'[end date]
              )
          ))
  • ninakarsa's avatar
    ninakarsa
    6 years ago

    this works perfect. thank you