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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Young_G_Han
Helper III
Helper III

How to sum the monthly average sales when the sales periods are different?

 Hi.

 

I have a very difficult issue...

 

I have to sum monthly average sales of many different items sold in different periods.

Periods are from each sales start date to today.

 

For example,

 

Product  Sales Start Date  Transaction Date Q'ty

A              2022-01-01       2021-02-01         100

B               2022-03-12      2021-04-11          200

A              2022-01-01       2023-02-01          100

B               2022-03-12      2022-04-11           50

 

In the case of product A, the period from 2022-01-01 to 2023-05-04, so the average of the monthly sales I want is 200 / 17months = 11.76.

Product B, the period from 2022-03-01 to 2023-05-04, so the average of the monthly sales I want is 250 / 15months = 16.67.

 

I want the sum of each product's monthly average sales like 11.76 + 16.67.

Of course, I want to make a table and graphs showing the average monthly sales by product.

 

I already add a column in the table with the DATEDIFF( start date, today(), month) to get the period and divide the sales quantity by the month.

I could see the quantity in the table, but I could not sum the values. The visualization shows N/a as the answer.

How can I solve the problem...?

 

Please help.

1 ACCEPTED SOLUTION
Kannan_n
Advocate I
Advocate I

Hi @Young_G_Han 

 

From my understanding, you need the sum of the product value. I have added the screenshot please loot it 

I have added a new column in the Data View 

Differen = 'Table'[Qty]/DATEDIFF('Table'[Sdate],TODAY(),MONTH)
 
this only you need 

 

Kannan_n_0-1683177795785.png

Kannan_n_1-1683177871995.png

 

If the answer is Happy Give a Like & are satisfied with the Answer Make the question Resolved 

Thanks/Regards 

Kannan. N

View solution in original post

2 REPLIES 2
Young_G_Han
Helper III
Helper III

Thank you so much. I thought it would be the only solution.

Your logic is working.

Kannan_n
Advocate I
Advocate I

Hi @Young_G_Han 

 

From my understanding, you need the sum of the product value. I have added the screenshot please loot it 

I have added a new column in the Data View 

Differen = 'Table'[Qty]/DATEDIFF('Table'[Sdate],TODAY(),MONTH)
 
this only you need 

 

Kannan_n_0-1683177795785.png

Kannan_n_1-1683177871995.png

 

If the answer is Happy Give a Like & are satisfied with the Answer Make the question Resolved 

Thanks/Regards 

Kannan. N

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.