Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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)])

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.