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
Thimios
Helper II
Helper II

Hourly average sales

Hi all,

I have a large sales table (sample below) with sales lines for the last 5 years.

       Thimios_0-1708979595304.png

I need to calculate average hourly sales per year so I can have multiple lines in a visual such as the one below:

      Thimios_1-1708979735841.png

 

1 ACCEPTED SOLUTION

You didn't specify if you want this per order or per line item.  I assumed the former.

 

lbendlin_0-1709084285979.png

 

 

View solution in original post

8 REPLIES 8
talespin
Solution Sage
Solution Sage

hi @Thimios 

 

Is it possible to share pbix file sample data and with all sensitive data removed.

Here you are. Let me know if you need additional info.

https://we.tl/t-xVpUalv49d

Hard one @talespin. This is a huge model and requires lot of work...

Will try to provide a similar one, hopefully soon.

Not sure if the last one was the latest version @talespin .

Pls download this https://we.tl/t-nGsshiJaP9 

You didn't specify if you want this per order or per line item.  I assumed the former.

 

lbendlin_0-1709084285979.png

 

 

Thank you @lbendlin, worked perfectly.

I also created a similar measure per day.

 

Sales Avg Daily =
var a = summarize('SALES', SALES[DATE])
var b = ADDCOLUMNS(a,"sm",CALCULATE(sum(SALES[VALUE])))
return AVERAGEX(b, [sm])
lbendlin
Super User
Super User

Sounds good. What have you tried and where are you stuck?

Thanks for asking @lbendlin .

Tried using Sales Avg Hourly = AVERAGEX( VALUES( 'Time Table'[Hour] ), [SALES] ) where 

  • 'Time Table' is a support table
  • SALES = SUM ('Sales'[VALUE])

What I get in line chart, shows Total Sales (the sum of sales) instead of the average.

Thimios_1-1709012645675.png

Here is the above as table:

Thimios_2-1709012707999.png

Could it be that a miss something about hte context?

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.