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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
garynorcrossmmc
Advocate IV
Advocate IV

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...

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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...

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors