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
mtrevisiol
Helper IV
Helper IV

Monthly average of average quantity

Hi everyone.

I've got this table:

mtrevisiol_0-1633939524800.png

that represents the sales of two months (august and september), the time (hour) when the sale took place (in different days of the month), the quantity sold and the name of the product sold.

I've represented in a bar chart the average quantity sold for each hour (from 8 to 18) for each month, which can be selected through a slicer:

mtrevisiol_1-1633939751829.png

 

My intent is to calculate the "average of the averages" of the quantities sold in each hour. According to the figure the calculation would be

(20+12+24+45+36,33+100+28,5+40,5+17+1)/10 = 32,43

 

Here is a PBIX file containing the data: https://www.dropbox.com/s/l44cnr2ut689ryp/Average%20per%20hour.pbix?dl=0

 

Many thanks!

1 ACCEPTED SOLUTION

Hi @mtrevisiol ,
Check if the measure Media di Media di Qty per Mese is working fine and is there any difference in the table structure between your dummy file and the actual table ?

 

Regards,

Jaideep

View solution in original post

4 REPLIES 4
jaideepnema
Solution Sage
Solution Sage

Hi @mtrevisiol ,
Create a measure like this:

Average Value = 

var num=SUMX(DISTINCT('Table'[Hour]),[Media di Media di Qty per Mese])

var den=DISTINCTCOUNTNOBLANK('Table'[Hour])

var calc= DIVIDE(num,den,BLANK())

return calc
 
this will give you the desired output:
jaideepnema_0-1633941131195.png

Please accept this as a solution if your question has been answered !!

Appreciate a Kudos 😀

Thanks @jaideepnema , the measure works perfectly in this dummy file, but I don't know why in my real file the numerator is incorrect (I get a sum that is lower than the real one), while the denominator is ok. Do you have any idea what the problem might be?

Hi @mtrevisiol ,
Check if the measure Media di Media di Qty per Mese is working fine and is there any difference in the table structure between your dummy file and the actual table ?

 

Regards,

Jaideep

Thanks @jaideepnema it works perfectly.

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.