Forum Discussion
Anonymous
2 years agoNot applicable
Count Rows from Related Table with Filters
Been away from PowerBI for a few years and trying to get back into it but having a challenge with a relatively easy calculation. I have two tables "Person" and "History" with a one-to-many relati...
Anonymous
2 years agoNot applicable
I finally got something working but it is likely not the most efficient. I know I calculated various percentages from related tables for Cards in the past and don't remember doing them this way. Here is the DAX I used:
MEASURE =
CALCULATE(
DIVIDE(
COUNTROWS(FILTER('PERSON', CONTAINS(HISTORY,[PersonID], 'PERSON'[PersonId]) && PERSON[Indicator]="Y"))
,
COUNTROWS(FILTER('PERSON', CONTAINS(HISTORY,[PersonID], 'PERSON'[PersonId])
))))
- Ashish_Mathur2 years agoSuper User
Hi,
Share data in a format that can be pasted in an MS Excel file and show the expected result clearly.