Forum Discussion
ninakarsa
6 years agoHelper II
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...
- 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] ) )) - 6 years ago
this works perfect. thank you
Greg_Deckler
6 years agoCommunity Champion
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
6 years agoHelper II
this works perfect. thank you