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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
1001
Resolver II
Resolver II

A DAX Calculation Question

Hi All, I have a column of values (production forecast) and a date table with the column, Week Begining applied to the filters Pane.

 

I've filtered out any zero values and have Average Forecast = AVERAGE(Budget [Forecast]).

 

With the Week Begining column applied to the filters pane on the Report page. Would the DAX be calculationg the average daily volume, or weekly volume per the filter applied?

 

Ideally, I'm looking the average weekly volume.

 

Thanks All.   

 

 

1 ACCEPTED SOLUTION
amustafa
Super User
Super User

You can try these 2 new measures

Total Forecast by Week = CALCULATE(SUM(Budget[Forecast]), ALLEXCEPT(Budget, Date[Week Beginning]))

Average Weekly Volume = AVERAGEX(VALUES(Date[Week Beginning]), [Total Forecast by Week])





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @1001 ,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
amustafa
Super User
Super User

You can try these 2 new measures

Total Forecast by Week = CALCULATE(SUM(Budget[Forecast]), ALLEXCEPT(Budget, Date[Week Beginning]))

Average Weekly Volume = AVERAGEX(VALUES(Date[Week Beginning]), [Total Forecast by Week])





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




amustafa
Super User
Super User

If your goal is to calculate the overall average across multiple selected weeks, you might need a slightly different approach. One way is to use a measure that sums all the forecast values and then divides by the number of distinct weeks in your filtered context, something like this: (create three measures)
Total Forecast = SUM(Budget[Forecast])
Number of Weeks = DISTINCTCOUNT(Date[Week Beginning])
Average Weekly Volume = DIVIDE(Total Forecast, Number of Weeks)





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi Armustafa, unfortunately that calculation won't give me an accurate average as each week will have different volumes.

 

I really need to group the Forecast units by Week Beginning, then average those totals for the 52 weeks. For example. the Sum volume for week one is 300 units. Each week, that sum will be different, and those weekly totals need to be averaged.  Thanks.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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