I have a table with multiple date columns. As we cannot use two separate x axis is same chart, I am creating a separate table with required data.
My old table has a categorical column "label" and a date column "date". My new table has a "date" column, and I want the following data,
Count of distinct labels from old_table, where old_table.date == new_table.date
Basically, the distinct equivalent of following query,
FOOBAR = COUNTROWS(FILTER(OLD_TABLE[LABELS], OLD_TABLE[DATE] = NEW_TABLE[DATE]))
I can't use CALCULATE
, as that does not support comparing two columns to each other. I can't use COUNTROWS
with FILTER
, as that does not give distinct count. I can't use DISTINCTCOUNT
, as that doesn't support FILTER
.
I also tried GROUPBY
, as follows
TABLE = GROUPBY(OLD_TABLE, OLD_TABLE[DATE].[Date], "A", COUNTX(CURRENTGROUP(), DISTINCT(OLD_TABLE[LABELS])))
This gives the error, "Interface not implemented". However it works if I remove DISTINCT
.
What is an alternative?