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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Monthly join and leave

Hi, 

 

I would like to calculate the total monthly join and leave, The data is as below : 

 

NameDate JoinDate LeaveUser Type
A116/06/2001 08/07/2019 Internal
A203/01/201229/04/2019Internal
A323/05/2013 17/10/2019 External
A414/03/2016 06/11/2019 External
A514/03/2016 00:00:00 External
A613/03/2017 00:00:00 External
A713/03/2017 00:00:00 External
A820/03/2017 00:00:0006/11/2019 07:24:33Internal
A919/03/2017 00:00:0001/01/2020 00:00:00External
A1014/03/2016 00:00:00 External
A1114/03/201606/11/2019 Internal
A1213/03/2017  Internal
A1313/03/2017 11/01/2020 External
A14 11/01/2020 Internal
A1519/03/2017 01/12/2019 Internal

 

The employees could have the planned join/leave date. And they can have the date leave but not the date join 😞

The join and leave must be separated by the User Type (Internal / External)

Could anyone here help please ?

Many thanks in advance.

 

 

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Please make sure there is active relationship between x-axis and slicer.

You can create active relationship between calendrier[date] and DateJoin and inactive relationship between calendrier[date] and DateLeave then use calendrier[date] as slicer and x-axis.

 

Best Regards,

Jay

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

You have joined both join and leave date with a date dimension. In case you do not have one, please refer and create

https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions

 

Once you do it, one join will be active and another one would be inactive. You need to use userelation in your calculation to choose the join.

 

Please refer the similar article

https://community.powerbi.com/t5/Desktop/DATE-RANGE-SLICERS-TO-COMPARE-NETSALES-OF-A-DATE-RANGE/td-p...

 

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Anonymous
Not applicable

Hi,

 

Thank you for your reply, I had a look but sorry I am new to PBI and it's not very clear for my case. 

I created 2 measures : 

 

Join = IF (
CALCULATE (
COUNT ( Ressource[NewDateDebut] );
USERELATIONSHIP ( Calendrier[Date]; Ressource[NewDateDebut] )
)
= BLANK ();
0;
CALCULATE (
COUNT (Ressource[NewDateDebut] );
USERELATIONSHIP (Calendrier[Date]; Ressource[NewDateDebut] )
)
)
 
 
 
Leave = IF (
COUNT ( Ressource[NewDateFin] ) = BLANK ();
0;
COUNT ( Ressource[NewDateFin] )
)
 
The problem is that the X Asix didn't filter when I change the date slicer. 
 
image.png

Hi @Anonymous ,

 

Please make sure there is active relationship between x-axis and slicer.

You can create active relationship between calendrier[date] and DateJoin and inactive relationship between calendrier[date] and DateLeave then use calendrier[date] as slicer and x-axis.

 

Best Regards,

Jay

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

 If possible please share a sample pbix file after removing sensitive information.
Thanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.