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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.