Forum Discussion
sanjayjob89
4 years agoRegular Visitor
COUNTIF in DAX
Column1 Column2 Row1 Yes Yes Row 2 Yes No In aformentioned table, I want to create Column3 with count of Yes in Row1 and Row2. How I can i achieve th...
- 4 years ago
Step1
Coulmn1 Yes Count = IF('Sheet1 (3)'[Coulmn1]="Yes",1,0)Step2Coulmn2 Yes Count = IF('Sheet1 (3)'[Column2]="Yes",1,0)Step3Solution = 'Sheet1 (3)'[Coulmn1 Yes Count]+'Sheet1 (3)'[Coulmn2 Yes Count]One-Step Solution
Solution=IF('Sheet1 (3)'[Coulmn1]="Yes",1,0)+IF('Sheet1 (3)'[Column2]="Yes",1,0)
Regards,
Ritesh
Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !!Power BI for Tableau Users
sanjayjob89
4 years agoRegular Visitor
Even if I change it to OR count of Yes in row1 will be 1 not 2.
Whitewater100
Solution Sage
4 years agoSorry: I misunderstood.
Count Yes's = IF(AND('Table'[Column1] = "Yes", 'Table'[Column2] = "Yes"),2,IF(OR('Table'[Column1] = "Yes", 'Table'[Column2] = "Yes"),1))
I hope this is OK now. Thanks..