Forum Discussion
hosea_chumba
Helper I
3 years agoDax Formula
Take the example below, Please assist to come up with a formula that identifies the common items appearing in all the months. Date (DD/MM/YYYY) Item 01/08/2022 X 03/08/2022 Y 01/09/...
FreemanZ
Super User
3 years agohi hosea_chumba
I can only sovle this with a helper column.
1) add a calculated column like:
Month = FORMAT([Date], "YYYYMM")
2) create a calculated table like this:
List =
VAR _monthcount = DISTINCTCOUNT(TableName[Month])
RETURN
FILTER(
VALUES(TableName[Item]),
CALCULATE(DISTINCTCOUNT(TableName[Date])=_monthcount)
)
it worked like this:
- FreemanZ3 years ago
Super User
hi hosea_chumba
just realized you have in maximum one row per item every month.
So the list - calculated table could be achieved without the helper column, like this:
List2 = VAR _table = ADDCOLUMNS( TableName, "YYYYMM", FORMAT(TableName[Date], "YYYYMM") ) VAR _monthcount = COUNTROWS(SUMMARIZE(_table, [YYYYMM])) RETURN FILTER( VALUES(TableName[Item]), CALCULATE(DISTINCTCOUNT(TableName[Date])=_monthcount) )