Forum Discussion
BharatM
8 years agoNew Member
DAX - counting based on two columns
Hi, I am fairly new to DAX. I have been struggling all day to solve a particular problem and would be grateful if someone can help guide me. I have a list of customers and data looks like this (d...
- 8 years ago
I would suggest creating either a calculated column or measure using this code:
Chair only = IF ( CALCULATE ( SELECTEDVALUE ( Choices[Choice] ), ALLEXCEPT ( Choices, Choices[Customer ID] ) ) = "Chair", 1 )Then apply a visual level filter (or any sort of filter in the case of a calculated column) Chair only = 1
Anonymous
8 years agoNot applicable
Create a calculated column
IsChair = IF(Table1[Choice] = "Chair", 1, 0)
Then sum it in the display
BharatM
8 years agoNew Member
Will this not also count those customer IDs who have chair and desk or table? I want only those customers who have chair and nothing else as a selection.
- OwenAuger8 years agoSuper User
I would suggest creating either a calculated column or measure using this code:
Chair only = IF ( CALCULATE ( SELECTEDVALUE ( Choices[Choice] ), ALLEXCEPT ( Choices, Choices[Customer ID] ) ) = "Chair", 1 )Then apply a visual level filter (or any sort of filter in the case of a calculated column) Chair only = 1
- BharatM8 years agoNew Member
I can't thank you enough!!!!