cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wolfy_
Helper I
Helper I

Average per date day

Hi,

 

Can anyone help me figuring out where I'm faling to calculate tha "average delta" for the "Delta Forcast Date vs Actual Date (days)"

 

For example, for the actual date May 13 the "average delta" should be -23,41 days.

 

average delta.jpg

 

 

 

 

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @wolfy_ ,

I load your Excel file into Power BI

v-yangliu-msft_0-1622103734707.png

And calculate according to the following steps

1. Create measure.

Forcast Date vs Actual Date(days) = DATEDIFF(MAX('data'[Forcast Date End]),MAX('data'[Actual]),DAY)
averge delta = AVERAGEX(FILTER(ALL('data'),'data'[Actual]=MAX('data'[Actual])),[Measure_Delta Forcast Date vs Actual Date(days)])

2. Result:

v-yangliu-msft_1-1622103734714.png

I show the correct number. You can see if there is a filter on your side that has filtered the result, and clear it if there is any.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
watkinnc
Super User
Super User

I would try:

[Average Delta] = Calculate(Average([Delta Forecast Date vs Actual(Date)]), DISTINCT(Table[Actual]))

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!
v-yangliu-msft
Community Support
Community Support

Hi  @wolfy_ ,

I load your Excel file into Power BI

v-yangliu-msft_0-1622103734707.png

And calculate according to the following steps

1. Create measure.

Forcast Date vs Actual Date(days) = DATEDIFF(MAX('data'[Forcast Date End]),MAX('data'[Actual]),DAY)
averge delta = AVERAGEX(FILTER(ALL('data'),'data'[Actual]=MAX('data'[Actual])),[Measure_Delta Forcast Date vs Actual Date(days)])

2. Result:

v-yangliu-msft_1-1622103734714.png

I show the correct number. You can see if there is a filter on your side that has filtered the result, and clear it if there is any.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-yangliu-msft
Community Support
Community Support

Hi  @wolfy_  ,

Here are the steps you can follow:

1. Create measure.

Delta Forcast Date vs Actual Date(days) = DATEDIFF(MAX('Table'[Forcast Date End]),MAX('Table'[Actual]),DAY)
averge delta =
AVERAGEX(FILTER(ALL('Table'),'Table'[Actual]=MAX('Table'[Actual])),[Delta Forcast Date vs Actual Date(days)])

2. Result.

v-yangliu-msft_0-1621406645467.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yangliu-msft 

 

The solution average delta  you provided is that what I need. After implement it from my side it seems that someting is off.

 

For example, to Actual of May 14 should be -34 as your example but for me is giving -8,5 day's.

For May 21 the average should be -24,67 and is -10,99.

 

It is possible that I'm performing someting wrong?

 

My meseruments as you said are:

 

Delta Forcast Date vs Actual Date(days) = DATEDIFF(MAX('Query1'[Forcast Date End]),MAX('Query1'[Actual]),DAY)
 
averge delta =
AVERAGEX(FILTER(ALL('Query1'),'Query1'[Actual]=MAX('Query1'[Actual])),[Delta Forcast Date vs Actual Date(days)])

 

I'm unable to post here the sample table whitout html error's

here is the link for it

https://drive.google.com/file/d/1Dl23Q22G_bSEHJZXdgvrRu7lEziKQ_wk/view?usp=sharing

 

Thanks in advance for the help

amitchandak
Super User
Super User

@wolfy_ , is this a measure?

if yes, values should include the group by of visual

averagex(values(Query1[Group by]),[Delta Forcast Date vs Actual Date (days)])

 

 

averagex(summarize(Query1, Query1[Group by],Query2[Group by],"_1" ,[Delta Forcast Date vs Actual Date (days)]),[_1])

 

if this is a column 

averagex(Table,[Delta Forcast Date vs Actual Date (days)])

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
!! Subscribe to my youtube Channel !!

Hi @amitchandak 

Yes, it is a measure.

average delta =
AVERAGEX(
VALUES(Query1[Actual]),
[Delta Forcast Date vs Actual Date (days)]
)



I did not understood how to proced whit [Group by]
How should the measure be?

Helpful resources

Announcements
May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through June10th!

Power BI Dev Camp Session 22 without aka link and time 768x460.jpg

Check it Out!

Watch Session 22 Ted's Dev Camp along with past sessions!

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!

Top Kudoed Authors