Hi, I have a TMOV table containing DATE and PRODUCT columns, among other columns, that is related with a TDATE table containing DATE and YEAR_MONTH columns.
I would like to populate an additional column in the TMOV table with DISTINCTCOUNT of YEAR_MONTHS by PRODUCT, i.e. number of months that a product moved.
I tried with =CALCULATE(DISTINCTCOUNT(TDATE[YEAR_MONTH]); ALLEXCEPT(TMOV;TMOV[PRODUCT])) but is returning for all records the number of year_months that I have in the TDATE table (i.e. 36 -> 3 years) and not by specific product...
Adding the YEAR_MONTH column to the TMOV table it would work: =CALCULATE(DISTINCTCOUNT(TMOV[YEAR_MONTH]); ALLEXCEPT(TMOV;TMOV[PRODUCT])) but I would like to avoid this way since I have YEAR_MONTH in TDATE table...
Could you please indicate me what I am doing wrong?
Many thanks in advance, Est Gas.
I would like to populate an additional column in the TMOV table with DISTINCTCOUNT of YEAR_MONTHS by PRODUCT, i.e. number of months that a product moved.
I tried with =CALCULATE(DISTINCTCOUNT(TDATE[YEAR_MONTH]); ALLEXCEPT(TMOV;TMOV[PRODUCT])) but is returning for all records the number of year_months that I have in the TDATE table (i.e. 36 -> 3 years) and not by specific product...
Adding the YEAR_MONTH column to the TMOV table it would work: =CALCULATE(DISTINCTCOUNT(TMOV[YEAR_MONTH]); ALLEXCEPT(TMOV;TMOV[PRODUCT])) but I would like to avoid this way since I have YEAR_MONTH in TDATE table...
Could you please indicate me what I am doing wrong?
Many thanks in advance, Est Gas.