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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
LeeI
Frequent Visitor

Creating A Calculated Field or Dax Measure for Hire date

I am struggling to come up with a way to Calculate a hire date with data from a table that I have been giving. Ultimately, I would like to be able to show the number of hires in a particular moment of time in a power BI visual. Additionally, I would like to be able to use the number of hires for a particular date, to show total reduction (if any) for a specific job title. This is what the data currently looks like for one agent, The example data listed below is for one agent. But I have every agent for several different job titles all in one table. 

User ID Employee Name Period Job Title 
Agent1IDAgent1Name4/1/2024Agent1JobTitle
Agent1IDAgent1Name3/1/2024Agent1JobTitle
Agent1IDAgent1Name2/1/2024Agent1JobTitle
Agent1IDAgent1Name1/1/2024 Agent1JobTitle

 

 

What I am hoping to accomplish, is look at each individual agent, and see what their last period is. In the example data above, the last period is 1/1/2024. This means that when the data was pulled in December, the agent did not exsist. Therefore his hire date was sometime in December (I am not looking to get a specific hire date), just to show that his hire month and year  was 12/1/2023. 

I have created several measures that does return the hire date. But when I go to use the measure in a matrix, it does not let me use the measure that I have created as a column or row. Because of this, I think that I either need to do this calculation to achieve the hire date and year in either power query, or in a calculated field. But I am unsure what the best way to do this would be. Ultimately, I believe that something like this would be what I am looking for. 

 

User ID Employee Name Period Job Title Hire Date 
Agent1IDAgent1Name4/1/2024Agent1JobTitle12/1/2023
Agent1IDAgent1Name3/1/2024Agent1JobTitle12/1/2023
Agent1IDAgent1Name2/1/2024Agent1JobTitle12/1/2023
Agent1IDAgent1Name1/1/2024 Agent1JobTitle12/1/2023
1 ACCEPTED SOLUTION

No worries

Lets try a different approach.

Create a custom column in your table

HireDate = 
VAR _FirstRecord = 
CALCULATE (
    MIN ( 'Table'[Column1]),
    FILTER (
        'Table',
        'Table'[Name] = EARLIER ( 'Table'[Name] )
    )
)

RETURN
EOMONTH(_FirstRecord, -2) +1

 

 

 

Joe_Barry_1-1716905331051.png

 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Learn about the Star Schema, it will solve many issues in Power BI!

Date tables help! Learn more



LinkedIn
Let's connect on LinkedIn


View solution in original post

4 REPLIES 4
Joe_Barry
Super User
Super User

Hi @LeeI 

 

First you need to define the first date in the record then minus - 1 month to find the Hire Date.

Hire Date = 
VAR _FirstDate = MIN('Table'[Column1])
RETURN
   EOMONTH(_FirstDate, -2) +1

 

Joe_Barry_0-1716903331528.png

Joe

Please mark as accepted if it answers your question




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Learn about the Star Schema, it will solve many issues in Power BI!

Date tables help! Learn more



LinkedIn
Let's connect on LinkedIn


Hey @Joe_Barry , I might not have been clear enough in my description, and I apologize. I have tried something similar to this, but I need to have the calculation look at each agent individually. If I use the DAX you sent over in a calculated column, it just finds the minium date in the period columnn for all agents, and returns the value of the previous month. I have tried adding another variable for agent ID,  but that does not appear to return my expected results either. Below is the dax expression that I have tried and is not working, and a table that shows what I am trying to accomplish. 

 

I have tried this dax expression to try to do it by agent, but it also does not appear to be working 

 

HireDateTest =
VAR MINPeriod = MIN(MorMemMonthly[PeriodFormatted])
VAR SelectedEMP = MorMemMonthly[Employee_ID]
RETURN
    Calculate (EOMONTH(MINPeriod,-1),SelectedEMP = MorMemMonthly[Employee_ID])

 

The Hire Date column is what I am trying to accomplish by creating a calculated field 

 

Employee ID EmployeeNAMEPeriod Hire Date 
Employee1ID John Doe 4/1/20242/1/2024
Employee1IDJohn Doe3/1/20242/1/2024
Employee2IDSam Smith4/1/202412/1/2023
Employee2IDSam Smith 3/1/202412/1/2023
Employee2IDSam Smith 2/1/202412/1/2023
Employee2IDSam Smith 1/1/202412/1/2023

No worries

Lets try a different approach.

Create a custom column in your table

HireDate = 
VAR _FirstRecord = 
CALCULATE (
    MIN ( 'Table'[Column1]),
    FILTER (
        'Table',
        'Table'[Name] = EARLIER ( 'Table'[Name] )
    )
)

RETURN
EOMONTH(_FirstRecord, -2) +1

 

 

 

Joe_Barry_1-1716905331051.png

 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Learn about the Star Schema, it will solve many issues in Power BI!

Date tables help! Learn more



LinkedIn
Let's connect on LinkedIn


Hi @Joe_Barry I believe that this accomplished exactly what I am looking for. Thank you for the prompt support! I do have a question for you though. It was my understanding that the calculate function has filters integrated into the function after the expression. In this particular example, why do you need to use the filter function within the calculate function. I guess what I am really asking, is do you know why the dax expression that I was using previously was not working? 

 

Anyway, I will mark your answer as the accepted solution. Thanks again! 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.