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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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?

 

Share with Power BI Enthusiasts: 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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors