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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
RaulPBI
Helper II
Helper II

one id code used in different tables

hi everybody

 

I have three tables, one of them is dimensional (id and names of my employees) and it has unique values. The others are fact tables, with diffenrent values (hours in differents sections or activities). I want to calculate total number of employees and I had some duplicated value because some people work in more than one activity. So, the measure shows more employees that I really have. Any idea about how to calculate this properly?

 

Thank you in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @RaulPBI,

 

I think you need to create a mapping table to store mapping records and used to convert different id.

Sample:

Index Table1 ID Table2 ID
1 123 abc
2 456 def

 

Regards,

Xiaoxin Sheng

View solution in original post

9 REPLIES 9
drewlewis15
Solution Specialist
Solution Specialist

What measure are you currently using?  Would CALCULATE(DISTINCTCOUNT... solve your issue?

I'm afraid no. More details?

What measure are you currently using?

I use "distinctcount" to count different values (worker´s number) in both fact tables, but the issue is that one single value can appear in both tables. So, how do you do to consider this repeated value as one value?

Anonymous
Not applicable

HI @RaulPBI,

 

Can you share some sample data for test?

 

Regards,

XIaoxin Sheng

2017-12-07 (2).png

 

What I mean is that I have the workers in tables "horasproduccionnaves" and "tablahoras1", but they are unique workers. I want to calculate "number of workers". Any help?

Anonymous
Not applicable

HI @RaulPBI,

 

Maybe you can try to use UNION function to merge these tables and use COUNTROWS function to get the count.

Sample:

Count workers =
COUNTROWS (
    DISTINCT ( UNION ( ALLSELECTED ( Table1[ID] ), ALLSELECTED ( Table2[ID] ) ) )
)

 

Regards,

Xiaoxin Sheng

That is no work because the tables have not the same columns.

Anonymous
Not applicable

Hi @RaulPBI,

 

I think you need to create a mapping table to store mapping records and used to convert different id.

Sample:

Index Table1 ID Table2 ID
1 123 abc
2 456 def

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors