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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors