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
Joshwaaa
Frequent Visitor

New table based on conditional dates

Good afternoon all

Hope you are keeping safe

 

I am looking to create a new table based on values in 2 other tables but I am struggling to identify the correct format. I have a table set up as (amongst other fields)

Org Level 2

Candidate Name

Candidate Submit DateCandidate Shortlist DateCandidate Interview Date
Org UKBarry1/1/201/2/201/3/20
Org UKBruce1/2/201/3/201/4/20

 

What I then want to is create a new table with the org level 2 as the initial column, then the following columns count the number of candidates in the respective following columns, based on their date.

 

So for March I would want to see

 

Org Level 2# Candidates Submit# Candidates Shortlist# Candidates Interview
ORG UK321
ORG Spain45243

 

Where each column shows the relevant data for the month. So that 3 would be three candidates submitted between 01 March and 31 March

 

Hopefully I make sense and someone able to offer advice!

Thank you

Josh

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Create a date table and join it with all three dates. One will active and two will be inactive. Use userelation to use the other dates

Try like

# Candidates Submit = CALCULATE(COUNT(Table[Candidate Name]),USERELATIONSHIP(Table[Candidate Submit Date],'Date'[Date]) )
# Candidates Shortlist = CALCULATE(COUNT(Table[Candidate Name]),USERELATIONSHIP(Table[Candidate Shortlist Date],'Date'[Date]) )
# Candidates Interview = CALCULATE(COUNT(Table[Candidate Name]),USERELATIONSHIP(Table[Candidate Interview Date],'Date'[Date]) )

 

Refer this blog, how it works: https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

Having trouble reconciling your expected output to the sample data provided. Is that the full sample data??

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler thank you for the reply

 

This was not, this was just a mock up I created, due to the nature of the data I am working with I was not able to provide actual data

amitchandak
Super User
Super User

Create a date table and join it with all three dates. One will active and two will be inactive. Use userelation to use the other dates

Try like

# Candidates Submit = CALCULATE(COUNT(Table[Candidate Name]),USERELATIONSHIP(Table[Candidate Submit Date],'Date'[Date]) )
# Candidates Shortlist = CALCULATE(COUNT(Table[Candidate Name]),USERELATIONSHIP(Table[Candidate Shortlist Date],'Date'[Date]) )
# Candidates Interview = CALCULATE(COUNT(Table[Candidate Name]),USERELATIONSHIP(Table[Candidate Interview Date],'Date'[Date]) )

 

Refer this blog, how it works: https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

That has worked beautifully! Thank you very much for the help 🙂 @amitchandak 

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.