Forum Discussion
Counting a column based on a filter from another column
- 2 years ago
Hi Anonymous -Create a measure to find the distinct students as below:
DistinctActiveStudents =
CALCULATE(
DISTINCTCOUNT('TableA'[Student #]),
FILTER(
'TableA',
COUNTROWS(
FILTER(
'TableB',
'TableA'[Student #] = 'TableB'[Student#] &&
'TableA'[Sibling #] = 'TableB'[Sibling#] &&
'TableB'[Status] = "Active"
)
) > 0
)
)Replace TableA and TableB as per your model and add the above measure to your visual.
Hope it works.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Hi Anonymous -Create a measure to find the distinct students as below:
DistinctActiveStudents =
CALCULATE(
DISTINCTCOUNT('TableA'[Student #]),
FILTER(
'TableA',
COUNTROWS(
FILTER(
'TableB',
'TableA'[Student #] = 'TableB'[Student#] &&
'TableA'[Sibling #] = 'TableB'[Sibling#] &&
'TableB'[Status] = "Active"
)
) > 0
)
)
Replace TableA and TableB as per your model and add the above measure to your visual.
Hope it works.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
- Anonymous2 years agoNot applicable
This worked.
Really appriciate your help!
Thank you!!