Forum Discussion
khalilliraqui
10 years agoRegular Visitor
Counting using related tables
I have three tables related to each others (two tables many-to-many) : lets take this as an example A person has many resources I wanted to count for example : for every resource the number ...
- Anonymous10 years ago
Hi khalilliraqui,
According to your description, you want to get the count of resource owner persons which first name start with “j”?
If as I said, you can follow below steps):
- Create sample table, ‘Person’, ’Personal Source’ , ‘Resource Type’.
‘Person’:
’Personal Source’:
‘Resource Type’:
- Write the Dax formula of requirement:
Recoure Count of Person Start with 'j' = DISTINCT( SELECTCOLUMNS('Personal Source',"Resource Type",RELATED('Resource Type'[Name]),"Count",COUNTX(FILTER('Personal Source','Personal Source'[Resource Type ID]=EARLIER('Personal Source'[Resource Type ID])&& LEFT(RELATED(Person[First Name]))="j"),'Personal Source'[Person ID])))Reference:
Regards,
Xiaoxin Sheng
Anonymous
10 years agoNot applicable
Hi khalilliraqui,
According to your description, you want to get the count of resource owner persons which first name start with “j”?
If as I said, you can follow below steps):
- Create sample table, ‘Person’, ’Personal Source’ , ‘Resource Type’.
‘Person’:
’Personal Source’:
‘Resource Type’:
- Write the Dax formula of requirement:
Recoure Count of Person Start with 'j' = DISTINCT( SELECTCOLUMNS('Personal Source',"Resource Type",RELATED('Resource Type'[Name]),"Count",COUNTX(FILTER('Personal Source','Personal Source'[Resource Type ID]=EARLIER('Personal Source'[Resource Type ID])&& LEFT(RELATED(Person[First Name]))="j"),'Personal Source'[Person ID])))
Reference:
Regards,
Xiaoxin Sheng