Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
Check it out now!Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
I have Table EmploymentDetails I will mention the importent columns
as You shown above I tired to create column to calculate Years of Service
"
could anyone help me to create a column and Measure please ?
Hi @amal_01
Try using this dax formula :
@amal_01 If I understand, you can just use MAX('Dates'[Date]) in place of TODAY(). Basically, get the last date selected by your slicer.
Hi @Greg_Deckler
thanks for response ,
but i Used MAX('EmploymentDetails'[EmploymentStartDate]) Does not work correctly ,
the employees are filtered by the slicer depande on thire EmploymentStartDate
but the Years of Service are not calculated based on slicer
For Exp:
as you shown here
the employee 12564 his EmploymentStartDate on 12/6/2020 and slicer is on 5/19/2022 so it sould be his Years of Service 1 year and 3 month not 4 Years
@amal_01 OK, first question is what is the Slicer based on? Is it a Dates table or is it some date column in the EmployementDetails table? If it is a Dates table, is that Dates table related to the EmploymentDetails table? It's impossible to answer the question reliably without some basic details.
Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
Hi @amal_01
We haven’t heard back from you regarding our previous response and wanted to check if your issue has been resolved.
If it has, please consider clicking “Accept Answer” and “Yes” if you found the response helpful.
If you still have any questions or need further assistance, feel free to let us know — we're happy to help!
Thank you!