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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply

Dividing by the number of weeks that have passed

I am trying to divide by the number of weeks that have passed in a promotion. So say I have a promotion that is lasting 6 weeks. I have 21 sales in the first 3 weeks. So I would want that number to be 7. If it was 24 sales in 4 weeks I would want it to be 6 etc. Any ideas on how to create this is a measure/calculated column?

1 ACCEPTED SOLUTION

Sales_Per_Week =  //try this
VAR Total_Sales = [Total Sales]
VAR Start_Date = [Start Date]
VAR Today_Date = TODAY()
VAR Weeks_Passed = INT((Today_Date - Start_Date) / 7) + 1
RETURN
    DIVIDE(Total_Sales, Weeks_Passed)

Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



View solution in original post

6 REPLIES 6
mh2587
Super User
Super User

share your sample data


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



 I am not sure how to insert the excel file, but here is a screenshot. 

BradyLinnebur_0-1715357129738.png

 

So say that the date is 3/31/2024. I wouldn't know what the future sales would be, but I wouldn't want to divide by those extra dates that haven't happened yet so it would be divided by 3 because 3 weeks have passed on the date of 3/31/2024.

Sales_Per_Week =  //try this
VAR Total_Sales = [Total Sales]
VAR Start_Date = [Start Date]
VAR Today_Date = TODAY()
VAR Weeks_Passed = INT((Today_Date - Start_Date) / 7) + 1
RETURN
    DIVIDE(Total_Sales, Weeks_Passed)

Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



mh2587
Super User
Super User

Average_Sales_Per_Week = 
VAR Total_Sales = [Total Sales] //Measure
VAR Weeks_Passed = [Weeks Passed] //Measure
RETURN
    DIVIDE(Total_Sales, Weeks_Passed)

Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



I don't have the measure in place for the [Weeks Passed]. I would need this piece as well if possible. I have a promotion Start date column and an End date column. I also have a week starting column.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.