Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Daily data quantity update by week

Hello,

 

I look for a measure DAX in Power BI that answers to this problem : 

 

I have daily Data  like this

 

ID Start Date End Date

1 1/01 3/01

2 4/01 

3 2/01 5/01

 

My measure calculate for a day, the average of the age of the ID

 

Exemple

 

1/01 : 0 (there is only 1)

2/01 : 1 (1 has 1 day)

3/01 : 1.5 (1 has a age of 2 and 3 has a age of 1 = 1+2/2)

4/01 : 1 has end date of 3/01 so stay with an age of 2, 3 has a age of 2 now) = 2+2/2 = 2

5/01 : 1 = 2, 3 = 3 and 2 = 1, => 2+3+1 = 6 / 3 = 2

6/01 : 1 = 2, 3 ended in 5/01 so = 3 and 2 = 2, => 2+3+2 = 7/3

 

Do you know how to do this ?

 

Thank you advance