The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have a table with a hire date and a re-hire date. I also have a slicer that changes my visuals to show information about those hired on the year selected. Currently this is only using the original hire date, however, I was wondering if it is possible to have someone who has been re-hired show up on both the original hire year and the re-hire year. I could use DAX to check and see if there is a re-hire date entry and for it to use that year if so, but I would much rather that entry show up in both years.
Thank you in advance!
Solved! Go to Solution.
Hi, @srpeters
I'm happy to answer your questions. You can use the following DAX to calculate whether there is a rehire date. If there is a rehire date, the rehire date will be returned. Otherwise, the hire date will be returned. According to your description, I used sample data:
DAX formula:
Rehiredate = IF(SELECTEDVALUE('Table'[Rehire date])<>BLANK(),CALCULATE(MIN('Tabelle1'[Rehire date])),CALCULATE(MIN('Table'[hire date])))
We use this measure in the Table visual;
The above settings allow the rehired person to appear in both the original hiring year and the rehiring year. I have provided the PBIX file used this time below. If this can help you, that would be great.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @srpeters
I'm happy to answer your questions. You can use the following DAX to calculate whether there is a rehire date. If there is a rehire date, the rehire date will be returned. Otherwise, the hire date will be returned. According to your description, I used sample data:
DAX formula:
Rehiredate = IF(SELECTEDVALUE('Table'[Rehire date])<>BLANK(),CALCULATE(MIN('Tabelle1'[Rehire date])),CALCULATE(MIN('Table'[hire date])))
We use this measure in the Table visual;
The above settings allow the rehired person to appear in both the original hiring year and the rehiring year. I have provided the PBIX file used this time below. If this can help you, that would be great.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous
This works great for my matrix, but in my bar graphs, I would like to have the count of each employees hire date or rehire date. Since this is a DAX measure, is it not possible for a bar graph to use this formula as its x-axis to represent the amount of people hired on the year selected (Regardless if that year was their original or re-hire dates year)?
Thank you so much for your help thusfar!
User | Count |
---|---|
12 | |
9 | |
6 | |
6 | |
6 |
User | Count |
---|---|
24 | |
14 | |
14 | |
9 | |
7 |