Forum Discussion
CJ_96601
2 years agoHelper V
Distinct count from two column if either statement is true
Distinct count from two column if either statement is true.
you may refer to below table - result is in the last column.
distinct Count column 1 and column 2
| Result | |||
| # Code | Column 1 | column 2 | Total Count |
| 1111 | F | S | 1 |
| 2222 | F | S | 1 |
| 3333 | F | 1 | |
| 4444 | F | S | 1 |
| 5555 | V | ||
| 6666 | F | 1 | |
| S | 1 | ||
| Total Count | 6 |
Thanks
6 Replies
- Anand24
Super User
Hi CJ_96601 ,
Create a new calculated column with below DAX:Total Count =
IF(
'Table'[Column 1] <> BLANK() || 'Table'[Column 1] <> BLANK(),
1,
BLANK()
)Here's the result:
Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!
Proud To Be a Super User !!!
LinkedIn - AnonymousNot applicable
Hi CJ_96601 ,
According to your statement, I suggest you to try code as below to create the measure.
Result = IF('Table'[Column 1] = "F" || 'Table'[column 2] <> BLANK(),1)Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- CJ_96601Helper V
|| 'Table'[column 2] - it says token "," expected
- Anand24
Super User
CJ_96601 ,
Create a calculated column with below DAX:Total Count =
IF(
'Table'[Column 1] = "F" || 'Table'[column 2] <> BLANK(),
1,
BLANK()
)Here's the result:
In case this doesn't work, please share a screenshot of error.
Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!
Proud To Be a Super User !!!
LinkedIn