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
Anonymous
Not applicable

How do I get the average number of units sold over a period of weeks.

I used a matrix to get the sum of the total units that had been sold in a 9 week period. This gives a total of 7600 and therefore should show an average of 844.44 per week. How do I replicate this information in PowerBI? When using the average it gives me an incorrect total average. (This will be due to there being multiple entries for each week number).

 

Iestyn123_1-1654265996873.png

 

This is my first post and first time using PowerBI so I may 

 

8 REPLIES 8
v-yanjiang-msft
Community Support
Community Support

Hi @Anonymous ,

Is your problem solved? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

If you need more help, please feel free to let me know.

Best Regards,
Community Support Team _ kalyj

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

FarhanAhmed
Community Champion
Community Champion

You should use Iterator Average Function to get the correct average

 

you DAX code should be looks like this

 


=AVERAGEX(Values(WeekNumber), [Total Units Sold])







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

Proud to be a Super User!




Anonymous
Not applicable

Hi, when I do this is doesn't allow me to select the colomn for total units sold? 

Create a measure Total Units and then use this measure in the Formula.







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

Proud to be a Super User!




Nahid_3152
Helper I
Helper I

Hi @Anonymous 

 

Try  in a Measure

Avg =
var A = COUNT(Sheet1[WeekNumber])
var B = SUM(Sheet1[Total Unit Sold])
return
B/A

Hi @Anonymous  

Or u can use this 

DIVIDE(SUM('Sheet1'[Total Unit Sold]), CALCULATE(COUNT('Sheet1'[WeekNumber]), ALLSELECTED()))


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

Proud to be a Super User!

Anonymous
Not applicable

Hi, Both your solutions return this:

 

Iestyn123_0-1654514121648.png

 

Hi @Anonymous 

Please see the below image

Screenshot_1.png

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.