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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
shahidalaila23
Frequent Visitor

How to calculate Average Daily Sales (ADS)

Hi, 

 

shahidalaila23_0-1626071091686.png

I'm trying to calculate average daily sales base on sample table above. For now if I calculate using measure, it will calculate only the total day of item sold and not the total month to date. As example, "IK YELLOW COPIER PAPER A4 450S 70G" only have 6 days of sales instead of total of 7 days. The measure calculate average for 6 days and not 7 days. 

 

below is the ADS formula that I use currently. 

 

qty ADS = AVERAGEX(VALUES(MASTERCALENDAR[DATE]),[qty total]) 
 
So the qty ADS should be 3.71 instead of 4.33 which is average for 7 days and not 6 days. 
 
2 REPLIES 2
amitchandak
Super User
Super User

@shahidalaila23 , seem fine at high level,

 

Try like

qty ADS = AVERAGEX(Summarize(MASTERCALENDAR,MASTERCALENDAR[itemcode], MASTERCALENDAR[DATE],"_1",[qty total]), [_1])

 

Can you share sample data and sample output in table format?

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi yes, 

 

Main data table *this my data table

shahidalaila23_0-1626073198857.png

and I have a master calender table 

 

I have try the measure but it still show same result 

 

test ads = AVERAGEX(SUMMARIZE('MAIN DATA TABLE', 'MAIN DATA TABLE'[itemcode],'MASTERCALENDAR'[DATE], "1", [qty total]),[1])
 
shahidalaila23_1-1626073353475.png

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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