Forum Discussion
DAX count with count filter
Hi bvanevr
Try this
Go to Modelling Tab and press the "NEW TABLE" button
New Table =
FILTER (
SUMMARIZE (
TableName,
TableName[Sold to],
"ID Count", DISTINCTCOUNT ( TableName[ID] )
),
[ID Count] > 1
)Thanks for the fast response
I was able to create the table, but it does not allow for dynamic filtering from within the report. For example if the user does not want status = X In that case the count for Sold-to = 1 would not be 3 but 2 and Sold to = 2 would be 1 and would be filtered out.
Returns counts of
1 | 2
2 | 1
3 | 1
Filter for > 1 -- Sold to # 1 has 2 associated ID's which is an error
1 | 2
- Zubair_Muhammad8 years agoCommunity Champion
Hi, Use this Measure in the Table. Then you can add a slicer for Status
ID Count = CALCULATE ( DISTINCTCOUNT ( TableName[ID] ), FILTER ( VALUES ( TableName[Sold to] ), CALCULATE ( DISTINCTCOUNT ( TableName[ID] ) > 1 ) ) )- Zubair_Muhammad8 years agoCommunity Champion
- bvanevr8 years agoAdvocate II
Thanks Zubair,
I was able to replicate your solution.
Would you be able to help with 2 phase of my question? I need to be able to provide users with an item to click that would act as a filter to only display those records >1 independent of the dynamic filter for Status. Idealy a table with one value "Click to Filter Mult IDs".
In the past I used a 2nd table to map values, but since we are generating the count on the fly so the count is not a column in the ingested table, I cant create a relationship on the count.