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
garynorcrossmmc
Advocate II
Advocate II

Calculating 'In' and 'Out' Records

Hi all,

I have a data table that looks like this:

PERSONIDEFFFROMDATEEFFTODATETNFR_CC_CHANGE_INDIM_FROM_RC_KEYDIM_RC_KEY
10031103/1/20183/31/201816740068211
10031108/1/20208/1/202016821170515

 

Each record with a value of 1 for the TNFR_CC_CHANGE_IN field represents an employee transfer.  The request from the user base is identify where there is a transfer in and a transfer out (2 separate measures) based on the selected DIM_RC_KEY value.  So, if a user filtered the report on DIM_RC_KEY = 70515 (or any attributes related to this value), the 'Transfer In' measure should show a value of 1.  If a user filtered the report on DIM_RC_KEY = 68211, the 'Transfer Out' measure should show a value of 1.  

Is this possible to achieve through 2 measures?

 

Thanks in advance!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@garynorcrossmmc , The two columns should join with a common dimension DIM_RC and there will be one inactive join, that can be activated using userelationship

example

CALCULATE(
SUM('Table'[personID]),

USERELATIONSHIP('DIM_RC'[DIM_RC_KEY],'Table'[DIM_FROM_RC_KEY])
)

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@garynorcrossmmc , The two columns should join with a common dimension DIM_RC and there will be one inactive join, that can be activated using userelationship

example

CALCULATE(
SUM('Table'[personID]),

USERELATIONSHIP('DIM_RC'[DIM_RC_KEY],'Table'[DIM_FROM_RC_KEY])
)

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

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.