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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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?

 

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.