Forum Discussion
DAX measure or Summarized table
- 2 years ago
Got you. A bit funky but here you go:
I created a concatenated column that would give me a Person + Rating so I could count that key. After that I created this measure that would give me the total occurrences of this key (I want everything that's just 1):
CountAllS = CALCULATE(COUNT('Table'[PersonRating]), ALLEXCEPT('Table', 'Table'[PersonRating]))After this, I created a measure that counts the number of times this measure is just 1 and only for those that were rated by the manager:
Unique Count = CALCULATE(COUNTROWS(FILTER(KEEPFILTERS(SUMMARIZECOLUMNS('Table'[PersonRating], "Count", [CountAllS])), [Count] < 2)), 'Table'[Rated by] = "Manager")Find attached my working file so you can take a dive on it 🙂
- Anonymous2 years ago
Hi Anonymous ,
Your solution is great, ray_aramburo . It worked like a charm! Here I have another idea in mind, and I would like to share it for reference.
Just create a measure, the syntax is as follows:
Count = CALCULATE( DISTINCTCOUNT('Table'[Person]), FILTER( 'Table', 'Table'[Rated by] = "Manager" && CALCULATE( COUNTROWS('Table'), 'Table'[Rated by] = "Self" ) = 0 ) )Drag measure to the report page for display:
pbix file is attached.
If you have any further questions please feel free to contact me.
Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Why is Person C, rating a not included in your count?
Anyways the measure can be done in 2 ways (depending to the answer of my first question) :
Person Count = CALCULATE(COUNTROWS("TableName"), Rated by = "Manager")
If you need to explicitly indicate "a" rating then just modify it this way:
Person Count = CALCULATE(COUNTROWS("TableName"), Rated by = "Manager", Rating = "a")
If you need to address unique person then just use DISTINCTCOUNT([Person]) instead of COUNTROWS.
- Anonymous2 years agoNot applicable
Hi, thank you for yor reply. Person C rating a is not included as they have [Rated by] entry for both "Manager" and "Self". I just need those that only have a [Rated by] "Manager". Hence I'm not sure the simple COUNT or DISTINCTCOUNT will work.
- ray_aramburo2 years ago
Super User
Got you. A bit funky but here you go:
I created a concatenated column that would give me a Person + Rating so I could count that key. After that I created this measure that would give me the total occurrences of this key (I want everything that's just 1):
CountAllS = CALCULATE(COUNT('Table'[PersonRating]), ALLEXCEPT('Table', 'Table'[PersonRating]))After this, I created a measure that counts the number of times this measure is just 1 and only for those that were rated by the manager:
Unique Count = CALCULATE(COUNTROWS(FILTER(KEEPFILTERS(SUMMARIZECOLUMNS('Table'[PersonRating], "Count", [CountAllS])), [Count] < 2)), 'Table'[Rated by] = "Manager")Find attached my working file so you can take a dive on it 🙂