Forum Discussion
DAX Count Unique Id when another column contains two values in different rows.
- 3 years ago
Hi Eparfitt1002
Could you please attach a table with an example of data and the desired results so that we can better understand your request? - 3 years ago
Eparfitt1002
In order to achieve the desired outcome.
The first step is to add a calculated column that concatenates the texts by ID to the "height"
Dax Funtion:Concatenated Text = CONCATENATEX(FILTER('Table', 'Table'[UniqueID] = EARLIER('Table'[UniqueID])), 'Table'[Tags], ", ")A second step involves counting based on whether the combination you are seeking is present.
DAX formula for a measureCounter = CALCULATE(DISTINCTCOUNT('Table'[UniqueID]),CONTAINSSTRING('Table'[Concatenated Text],"Escalated Client, Agent Expressed Empathy"))**If string order can also be reversed, you can add another comparison
with OR conditionIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Do you only check that combination?
Right. I'm attempting to create a percentage that calculates how often my agents are using empathy during escalated calls.
So if it has the same UniqueID and those two values, it would count that call. Then I'll divide whatever that count is by the count of all the escalation calls to express it as a percentage.
Thanks!
- Ritaf19833 years ago
Super User
Eparfitt1002
In order to achieve the desired outcome.
The first step is to add a calculated column that concatenates the texts by ID to the "height"
Dax Funtion:Concatenated Text = CONCATENATEX(FILTER('Table', 'Table'[UniqueID] = EARLIER('Table'[UniqueID])), 'Table'[Tags], ", ")A second step involves counting based on whether the combination you are seeking is present.
DAX formula for a measureCounter = CALCULATE(DISTINCTCOUNT('Table'[UniqueID]),CONTAINSSTRING('Table'[Concatenated Text],"Escalated Client, Agent Expressed Empathy"))**If string order can also be reversed, you can add another comparison
with OR conditionIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.