Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
I have a data that looks like this. A person has multiple rows of data. Each event (such as promotion, hire, termination, rehire) equates to one row of data. I need to get each of their tenure and then add group/bin them accordingly.
If the current status is active then Newest Employment Date - Maximum Date based on selected slicer in the report. (if the slicer selected is Mar 2022, the max date is Mar 31 2022). Thus, Newest employment date - mar 31 2022. The max date adjusts based on the selected slicer.
If the current status is terminated then newest employment date - termination date.
If the selected slicer is less than the termination date then use that lesser date (because technically, it makes sense that way)
Then I should group them by 0-6 Months, 1-5 years, 6-10 years and so on and by their teams as well. Result should be a table that looks like this:
| 0-6 Months | 1-5 Years | 6-10 years | |
| IT | 10 | 5 | 2 |
| HR | 2 | 4 | 2 |
| Total | 12 | 9 | 4 |
Raw Data:
| Newest Employment Date | New Termination Date | Event | Current Status | Team | |
| Anne | 20/03/2021 | Hire | Active | IT | |
| Anne | 20/03/2021 | 09/02/2017 | Terminated | Active | IT |
| Anne | 20/03/2021 | Rehire | Active | IT | |
| Ben | 19/07/2022 | 29/12/2022 | Hire | Terminated | HR |
| Ben | 19/07/2022 | 29/12/2022 | Terminated | Terminated | HR |
| Carl | 19/07/2022 | Hire | Active | IT | |
| Carl | 19/07/2022 | Promotion | Active | IT | |
| Carl | 19/07/2022 | Change in Job Title | Active | IT |
Hi @Honne2021 ,
For now, the advice I can provide is to create a separate calendar table to provide filtered dates for the slicer.
The raw data provided seems a matrix visual in Power BI, right?
What does your data look like in data view in Power BI Desktop?
Please explain again how the expected results of IT and HR in the [0-6 Months] column came from, and if so, it is best to explain it based on the raw data from data view.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Sorry I think I wasnt clear on that. Here is a screenshot of an excel file I created to explain it clearly:
I already have a date table. 🙂
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 68 | |
| 33 | |
| 32 | |
| 31 |