Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Count the matching codes used in one table with other tables: Count the matching

Hi PowerBiers, I need you superior brain power!

 

 

I have a set of codes; Skills, Industries that are associated to People looking for jobs and those looking to hire people, as well as the job records and Organisations. 

 

Below three examples tables;

 

 

CompanyCode TypeCode CandidateCode TypeCode JobCode TypeCode
BTSkillsJAVA John SmithSkillsJAVA DeveloperSkillsJAVA
BTSkills.NET John SmithSkills.NET DeveloperSkills.NET
BTIndustryTelecoms John SmithIndustryTelecoms DeveloperIndustryTelecoms
    John SmithSkillsSQL DeveloperSkillsVBA

 

I need to represent in a table that totals these matches on codes and then show whether a sales/activity transaction has occurred. 

 

 CandidateContacts/Contact with an action related to personJobsCompanies
John Smith 50/525/1015/5
Joe Bloggs45/4010/05/5

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

 

You can refer to below steps to create the summary table if it suitable for your requirement:

 

Steps:

1. Summary three table and add the tag.

Summary= UNION(SELECTCOLUMNS(Sheet2,"Type","Company","Name",[Company],"Code",[Code Type]&" "&[Code]),SELECTCOLUMNS(Sheet3,"Type","Candidate","Name",[Candidate],"Code",[Code Type]&" "&[Code]),SELECTCOLUMNS(Sheet4,"Type","Job","Name",[Job],"Code",[Code Type]&" "&[Code]))

2.PNG

 

 

2. Use var function to store the above table, and add variables to log the table count.

Summary = 
var temp= UNION(SELECTCOLUMNS(Sheet2,"Type","Company","Name",[Company],"Code",[Code Type]&" "&[Code]),SELECTCOLUMNS(Sheet3,"Type","Candidate","Name",[Candidate],"Code",[Code Type]&" "&[Code]),SELECTCOLUMNS(Sheet4,"Type","Job","Name",[Job],"Code",[Code Type]&" "&[Code]))
var Contacts=COUNTROWS(FILTER(temp,[Type]="Candidate"))
var Company=COUNTROWS(FILTER(temp,[Type]="Company"))
var Job=COUNTROWS(FILTER(temp,[Type]="Job"))
return
temp

3.PNG

 

 

3. Summary temp table and calculate the count.

Summary = 
var temp= UNION(SELECTCOLUMNS(Sheet2,"Type","Company","Name",[Company],"Code",[Code Type]&" "&[Code]),SELECTCOLUMNS(Sheet3,"Type","Candidate","Name",[Candidate],"Code",[Code Type]&" "&[Code]),SELECTCOLUMNS(Sheet4,"Type","Job","Name",[Job],"Code",[Code Type]&" "&[Code]))
var Contacts=COUNTROWS(FILTER(temp,[Type]="Candidate"))
var Company=COUNTROWS(FILTER(temp,[Type]="Company"))
var Job=COUNTROWS(FILTER(temp,[Type]="Job"))
return
SUMMARIZE(FILTER(temp,[Type]="Candidate"),[Name],
    "Current Contacts/All",COUNTROWS(FILTER(temp,[Name]=EARLIER([Name])))&"/"&Contacts,
    "Suitable Job/All",COUNTROWS(INTERSECT(SELECTCOLUMNS(FILTER(temp,[Type]="Candidate"&&[Name]=EARLIER([Name])),"Code",[Code]), SELECTCOLUMNS(FILTER(temp,[Type]="Job"),"Code",[Code])))&"/"&Job,
    "Suitable Company/All",COUNTROWS(INTERSECT(SELECTCOLUMNS(FILTER(temp,[Type]="Candidate"&&[Name]=EARLIER([Name])),"Code",[Code]), SELECTCOLUMNS(FILTER(temp,[Type]="Company"),"Code",[Code])))&"/"&Company
    )

4.PNG

 

 

Notice: the company count means the suitable company records count.(not the unique value)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

 

You can refer to below steps to create the summary table if it suitable for your requirement:

 

Steps:

1. Summary three table and add the tag.

Summary= UNION(SELECTCOLUMNS(Sheet2,"Type","Company","Name",[Company],"Code",[Code Type]&" "&[Code]),SELECTCOLUMNS(Sheet3,"Type","Candidate","Name",[Candidate],"Code",[Code Type]&" "&[Code]),SELECTCOLUMNS(Sheet4,"Type","Job","Name",[Job],"Code",[Code Type]&" "&[Code]))

2.PNG

 

 

2. Use var function to store the above table, and add variables to log the table count.

Summary = 
var temp= UNION(SELECTCOLUMNS(Sheet2,"Type","Company","Name",[Company],"Code",[Code Type]&" "&[Code]),SELECTCOLUMNS(Sheet3,"Type","Candidate","Name",[Candidate],"Code",[Code Type]&" "&[Code]),SELECTCOLUMNS(Sheet4,"Type","Job","Name",[Job],"Code",[Code Type]&" "&[Code]))
var Contacts=COUNTROWS(FILTER(temp,[Type]="Candidate"))
var Company=COUNTROWS(FILTER(temp,[Type]="Company"))
var Job=COUNTROWS(FILTER(temp,[Type]="Job"))
return
temp

3.PNG

 

 

3. Summary temp table and calculate the count.

Summary = 
var temp= UNION(SELECTCOLUMNS(Sheet2,"Type","Company","Name",[Company],"Code",[Code Type]&" "&[Code]),SELECTCOLUMNS(Sheet3,"Type","Candidate","Name",[Candidate],"Code",[Code Type]&" "&[Code]),SELECTCOLUMNS(Sheet4,"Type","Job","Name",[Job],"Code",[Code Type]&" "&[Code]))
var Contacts=COUNTROWS(FILTER(temp,[Type]="Candidate"))
var Company=COUNTROWS(FILTER(temp,[Type]="Company"))
var Job=COUNTROWS(FILTER(temp,[Type]="Job"))
return
SUMMARIZE(FILTER(temp,[Type]="Candidate"),[Name],
    "Current Contacts/All",COUNTROWS(FILTER(temp,[Name]=EARLIER([Name])))&"/"&Contacts,
    "Suitable Job/All",COUNTROWS(INTERSECT(SELECTCOLUMNS(FILTER(temp,[Type]="Candidate"&&[Name]=EARLIER([Name])),"Code",[Code]), SELECTCOLUMNS(FILTER(temp,[Type]="Job"),"Code",[Code])))&"/"&Job,
    "Suitable Company/All",COUNTROWS(INTERSECT(SELECTCOLUMNS(FILTER(temp,[Type]="Candidate"&&[Name]=EARLIER([Name])),"Code",[Code]), SELECTCOLUMNS(FILTER(temp,[Type]="Company"),"Code",[Code])))&"/"&Company
    )

4.PNG

 

 

Notice: the company count means the suitable company records count.(not the unique value)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.