March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello everyone!
We have two lists with vacancies: 1. Open 2. Filled
For both files we calculate the processing times. For the file with open vacancies we calculate the processing time from posting date until today and for the filled vacancies from posting date till date filled in.
In de open vacancies we calculate with the average processing time of last year the expected startdate. Now we put this in a separate Excel file, but we want to make this dynamic.
We want to use per posting date the average processing time of the two months before that date.
Can anyone help us with that?
Kind regards,
Stephanie
Solved! Go to Solution.
Hi @SvCappellen ,
You can try this query based on your previous sample file:
let
Bron = Table.Combine({Filled, Open}),
#"Removed Columns" = Table.RemoveColumns(Bron,{"Processingtime 2020", "Expected startdate"}),
#"Added Custom" =
Table.AddColumn(
#"Removed Columns", "Average", each
if [Date filled] = null then
let x = _ in
List.Average(
Table.SelectRows(
#"Removed Columns",each
([FunctionGroup] = x[FunctionGroup] and
[Posting date] <= x[Posting date] and
[Posting date] >= Date.AddMonths(x[Posting date],-2)
)
)[Processing time]
)
else null,type number
),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Expected Start time", each Date.From(Number.From([Posting date]) + [Average]),type date)
in
#"Added Custom1"
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @SvCappellen ,
Based on your description, seems not certain what is your expected output.
Some questons in this case that want to know:
Could you please consider taking an example from the sample file to explain the expected output in details so that members in the community could help you better.
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
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the questions.
1. We want to know for all dates what the average processing time is of the last two months. So for example for a posting date of July 30, 2021 we want to calculate the average processing times of all records that fall in the same function group with a posting date between April 30 and July 29.
Now we use to calculate the expected date filled the average processing time of last year from a separate Excel file that we manually fill. We want to get rid of that extra Excel file.
A example from the sample data:
Function | FunctionGroup | Posting date | Date filled | Processing time | Average | Expected startdate |
A | B | 12-11-2020 | 2-12-2020 | 20 | ||
B | A | 25-11-2020 | 18-12-2020 | 23 | ||
B | A | 25-11-2020 | 13-12-2020 | 18 | ||
D | B | 25-11-2020 | 15-12-2020 | 20 | ||
D | B | 1-12-2020 | 24-12-2020 | 23 | ||
C | B | 1-12-2020 | 19-12-2020 | 18 | ||
C | B | 1-12-2020 | 21-12-2020 | 20 | ||
B | A | 2-12-2020 | 25-12-2020 | 23 | ||
C | B | 4-12-2020 | 22-12-2020 | 18 | ||
A | A | 4-12-2020 | 24-12-2020 | 20 | ||
B | A | 21-12-2020 | 13-1-2021 | 23 | ||
D | B | 22-12-2020 | 9-1-2021 | 18 | ||
A | A | 24-12-2020 | 13-1-2021 | 20 | ||
A | A | 28-12-2020 | 20-1-2021 | 23 | ||
A | A | 31-12-2020 | 18-1-2021 | 18 | ||
D | B | 22-1-2021 | 186 | = AVERAGE PROCESSING TIME of the last two months before this post date | = Post date + average | |
D | B | 28-1-2021 | 180 | = AVERAGE PROCESSING TIME of the last two months before this post date | = Post date + average | |
B | B | 29-1-2021 | 179 | 66,14285714 | 5-4-2021 | |
D | B | 16-2-2021 | 161 | = AVERAGE PROCESSING TIME of the last two months before this post date | = Post date + average | |
D | B | 24-2-2021 | 153 | = AVERAGE PROCESSING TIME of the last two months before this post date | = Post date + average | |
A | A | 26-2-2021 | 151 | 20,5 | 18-3-2021 | |
A | A | 2-3-2021 | 147 | = AVERAGE PROCESSING TIME of the last two months before this post date | = Post date + average | |
C | A | 3-3-2021 | 146 | = AVERAGE PROCESSING TIME of the last two months before this post date | = Post date + average |
The Orange average is calculated from the orange records, the blue from the blue records.
Hope this make our question more clear.
Kind regards,
Stephanie
Hi @SvCappellen ,
You can try this query based on your previous sample file:
let
Bron = Table.Combine({Filled, Open}),
#"Removed Columns" = Table.RemoveColumns(Bron,{"Processingtime 2020", "Expected startdate"}),
#"Added Custom" =
Table.AddColumn(
#"Removed Columns", "Average", each
if [Date filled] = null then
let x = _ in
List.Average(
Table.SelectRows(
#"Removed Columns",each
([FunctionGroup] = x[FunctionGroup] and
[Posting date] <= x[Posting date] and
[Posting date] >= Date.AddMonths(x[Posting date],-2)
)
)[Processing time]
)
else null,type number
),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Expected Start time", each Date.From(Number.From([Posting date]) + [Average]),type date)
in
#"Added Custom1"
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
21 | |
16 | |
13 | |
13 | |
9 |
User | Count |
---|---|
36 | |
31 | |
20 | |
19 | |
17 |