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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Mardo
Frequent Visitor

Table Relations - counting the missing rows

Hello,

 

I have created two different tables from the main CUBE. The first table contains 1544 rows and shows the employee in 2017. The second table has 1804 rows that shows the number of employees in 2018. (The number of employees is increasing!).

 

Now, my question is: HOW to determine the number of employees who left OR joined the company??? We have Employee-ID as a key in both tables. Please anyone could help?

 

Thanks in advance,

Regards,

Mardo

2 ACCEPTED SOLUTIONS

Hi Mardo,

 

So your requirement is equal to achieve rows only appear in table1 and rows only appear in table2, right?

 

Merge(Left Anti and Right Anti) can meet your requirement, click query editor->Merge Queries->Select join kind as left anti or right anti.

 

After merged, you get two tables that contains only people left the company and only people joined the company.

 

Finally, apply and create a measure using count(table) to calculate the number of people.

 

Regards,

Jimmy Tao

View solution in original post

Anonymous
Not applicable
6 REPLIES 6
Anonymous
Not applicable

SELECT * FROM 2018 cy

RIGHT JOIN 2017 ly

ON cy.id = ly.id

WHERE cy.id IS NULL

 

 

 

Hello Richard,

 

Thank you for your reply.

 

I am just wondering if that code was a DAX-code?? I would need a DAX-formula to compare the values (User-ID) in the two columns from the two tables (to determine what is missing?)

 

I hope you understand my point?

 

Kindest regards,

Mardo

Hi Mardo,

 

So your requirement is equal to achieve rows only appear in table1 and rows only appear in table2, right?

 

Merge(Left Anti and Right Anti) can meet your requirement, click query editor->Merge Queries->Select join kind as left anti or right anti.

 

After merged, you get two tables that contains only people left the company and only people joined the company.

 

Finally, apply and create a measure using count(table) to calculate the number of people.

 

Regards,

Jimmy Tao

Hello Jimmy,

 

Thank you so much for your informative reply!

 

Actually I did already the same approach, however, I was't sure if that would give me corrects results. It seem that this solution is the only way to get this issue resolved.

 

I have got now another issue: I have a table that contains a column with a header "Employment Start Date". What I need to do is to calculate how long time have our employees been working for the company (until now!), do we have any DAX formula to calculate that?

 

Many thanks again,

Kindest regards,

Mardo

Anonymous
Not applicable

Hello Richard,

 

Thanx a lot for your reply.

 

Actually I have used the first DAX-formula, and it works well for me 🙂

 

Thanx again for you collaboration, it is most appreciated!

 

Kindest Regards,

Mardo

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Top Solution Authors