Forum Discussion
gracie494
Helper I
5 years agoDax - Count in Column based on a specific field
Hello, How do I perform a count of the Cons group in each specific reporting unit. The output I am trying to achieve is in green:
pls add all(), and have a try on below DAX.
calculate(distinctcount[consgroup],filter(ALL(table),[reportingunit]=max([reportingunit]))
9 Replies
- amitchandak
Super User
gracie494 , Try
a New column
= calculate(distinctcount(Table[ConsGroup]), filter(Table, [ reporting unit] =earlier([ reporting unit])))
- gracie494
Helper I
- Greg_Deckler
Community Champion
gracie494 Perhaps:
Measure = VAR __RU = MAX('Table'[Reporting Unit]) VAR __CG = MAX('Table'[ConsGroup]) RETURN COUNTROWS(FILTER(ALL('Table'),[Reporting Unit]=__RU && [ConsGroup]=__CG))- gracie494
Helper I
- ryan_mayu
Super User
maybe try
calculate(distinctcount[consgroup],filter(table,[reportingunit]=max([reportingunit]))