Forum Discussion
Duplicating missing dates data with the previous available date data.
Hi All,
I am new to Power BI. I have a scenario where i have got missing rows for some days in the given Table when ETL job gets failed and data are not being incremented in the DWH Table. Like below data:
| SNAPSHOT_DATE | EMP_ID | EMPLOYEE_GROUP_DESCR | SITE | COUNTRY | STATE | CITY | TEAM_NAME |
| 20/01/2024 | 1 | A | XY | IN | Maharashtra | Pune | Tiger |
| 20/01/2024 | 2 | B | XY | US | Oregon | Wil | Tiger |
| 20/01/2024 | 3 | A | PQ | IN | Bihar | Mfp | Lion |
| 22/01/2024 | 1 | A | XY | IN | Maharashtra | Pune | Tiger |
| 22/01/2024 | 2 | B | XY | US | Oregon | Wil | Tiger |
| 22/01/2024 | 3 | A | PQ | IN | Bihar | Mfp | Lion |
| 22/01/2024 | 4 | A | XY | DE | Hesse | Frankfurt | Lion |
| 25/01/2024 | 1 | A | XY | IN | Maharashtra | Pune | Tiger |
| 25/01/2024 | 2 | B | XY | US | Oregon | Wil | Tiger |
| 25/01/2024 | 3 | A | PQ | IN | Bihar | Mfp | Lion |
| 25/01/2024 | 4 | A | XY | DE | Hesse | Frankfurt | Lion |
| 25/01/2024 | 5 | B | PQ | DE | Bavaria | Munich | Tiger |
| 27/01/2024 | 1 | A | XY | IN | Maharashtra | Pune | Tiger |
| 27/01/2024 | 2 | B | XY | US | Oregon | Wil | Tiger |
| 27/01/2024 | 3 | A | PQ | IN | Bihar | Mfp | Lion |
| 27/01/2024 | 4 | A | XY | DE | Hesse | Frankfurt | Lion |
| 26/01/2024 | 5 | B | PQ | DE | Bavaria | Munich | Tiger |
As you can see that there are 4 dates i.e. 21/01/2024, 23/01,2024, 24/01/2024, 26/01/2024 for which job failed. So i just want to duplicate those missing dates data with the previous availble date data like below:
| SNAPSHOT_DATE | EMP_ID | EMPLOYEE_GROUP_DESCR | SITE | COUNTRY | STATE | CITY | TEAM_NAME |
| 20/01/2024 | 1 | A | XY | IN | Maharashtra | Pune | Tiger |
| 20/01/2024 | 2 | B | PQ | US | Oregon | Wil | Tiger |
| 20/01/2024 | 3 | A | KL | IN | Bihar | Mfp | Lion |
| 21/01/2024 | 1 | A | XY | IN | Maharashtra | Pune | Tiger |
| 21/01/2024 | 2 | B | PQ | US | Oregon | Wil | Tiger |
| 21/01/2024 | 3 | A | KL | IN | Bihar | Mfp | Lion |
| 22/01/2024 | 1 | A | XY | IN | Maharashtra | Pune | Tiger |
| 22/01/2024 | 2 | B | PQ | US | Oregon | Wil | Tiger |
| 22/01/2024 | 3 | A | KL | IN | Bihar | Mfp | Lion |
| 22/01/2024 | 4 | A | MN | DE | Hesse | Frankfurt | Lion |
| 23/01/2024 | 1 | A | XY | IN | Maharashtra | Pune | Tiger |
| 23/01/2024 | 2 | B | PQ | US | Oregon | Wil | Tiger |
| 23/01/2024 | 3 | A | KL | IN | Bihar | Mfp | Lion |
| 23/01/2024 | 4 | A | MN | DE | Hesse | Frankfurt | Lion |
| 24/01/2024 | 1 | A | XY | IN | Maharashtra | Pune | Tiger |
| 24/01/2024 | 2 | B | PQ | US | Oregon | Wil | Tiger |
| 24/01/2024 | 3 | A | KL | IN | Bihar | Mfp | Lion |
| 24/01/2024 | 4 | A | MN | DE | Hesse | Frankfurt | Lion |
| 25/01/2024 | 1 | A | XY | IN | Maharashtra | Pune | Tiger |
| 25/01/2024 | 2 | B | PQ | US | Oregon | Wil | Tiger |
| 25/01/2024 | 3 | A | KL | IN | Bihar | Mfp | Lion |
| 25/01/2024 | 4 | A | MN | DE | Hesse | Frankfurt | Lion |
| 25/01/2024 | 5 | B | MN | DE | Bavaria | Munich | Tiger |
| 26/01/2024 | 1 | A | XY | IN | Maharashtra | Pune | Tiger |
| 26/01/2024 | 2 | B | PQ | US | Oregon | Wil | Tiger |
| 26/01/2024 | 3 | A | KL | IN | Bihar | Mfp | Lion |
| 26/01/2024 | 4 | A | MN | DE | Hesse | Frankfurt | Lion |
| 26/01/2024 | 5 | B | MN | DE | Bavaria | Munich | Tiger |
| 27/01/2024 | 1 | A | XY | IN | Maharashtra | Pune | Tiger |
| 27/01/2024 | 2 | B | PQ | US | Oregon | Wil | Tiger |
| 27/01/2024 | 3 | A | KL | IN | Bihar | Mfp | Lion |
| 27/01/2024 | 4 | A | MN | DE | Hesse | Frankfurt | Lion |
| 27/01/2024 | 5 | B | MN | DE | Bavaria | Munich | Tiger |
Thank you very much for your response.
Cheers,
Sundar
5 Replies
- lbendlin
Super User
And what do you want to do with the data afterwards?
- AnonymousNot applicable
I would like to show this in line chart about how headcount for each "team" and "employee group descr" are progressing in the time-period.
- lbendlin
Super User
I recommend you use a disconnected calendar table and measures.
- AnonymousNot applicable
Hi lbendlin ,
I would like to group by the data w.r.t. Snapshot_date, Employee_Group_Descr, and Team_Name and count the number of employees. I would like to use the Country, State and City as the filters to the visualization.
Please let me know in case you have some more questions.
Cheers,
Sundar
- Ashish_Mathur
Super User
Hi,
Assuming the first table is the only input table we have, could you show the final expected result in a simple Table format?