cancel
Showing results for
Did you mean:  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. 1 ACCEPTED SOLUTION  Community Support

Hi  @wolfy_ , 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: 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.

6 REPLIES 6  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!!  Community Support

Hi  @wolfy_ , 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: 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.  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. 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.  Helper I

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

Thanks in advance for the help  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)])

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 !!  Helper I

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? Announcements #### The Power BI Community Show

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

Put your data visualization and design skills to the test! This exciting challenge is happening now through June10th! Top Solution Authors
Top Kudoed Authors
Users online (2,896)