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
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
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.