Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a table with a column that supplies a start date for a reopening of any given ID. In another table I have the current and historical operating data for the ID by date with key items like sales qty.
I am in need of taking the reopening date as the starting point and calculate out in 28 day (4wk) increments the sales qty in each cycle before and since the reopen date. This is to run as a comparison of how the ID has performed before and since the repopen.
Since every reopen date can be different, how can I accomplish the date variability with the incremental summing or counting?
Thanks in advance!
Solved! Go to Solution.
Hi @unknown917 please try this
create a calculated column in your sales table for the week buckets
And then create the measure to sum the sales based on the buckets
Sales_by_Weeks =
VAR SelectedWeek = SELECTEDVALUE('SalesData'[Week_Bucket])
RETURN
CALCULATE(SUM('SalesData'[Sales Qty]), 'SalesData'[Week_Bucket] = SelectedWeek)
Hi @unknown917 please share the sample pbix file if possible.
My apologies, @techies - I am unable to share a file, but here is a sample of the tables I'm referring to:
table 1 | |
ID | ReOpenDate |
1 | 1/6/2025 |
2 | 2/17/2025 |
3 | 1/13/2025 |
4 | 11/4/2024 |
5 | 3/10/2025 |
table 2 | ||
ID | Inv Date | Sales Qty |
1 | 9/9/2024 | 150 |
1 | 9/12/2024 | 175 |
1 | 9/16/2024 | 205 |
1 | 9/19/2024 | 234 |
2 | 11/13/2024 | 17 |
2 | 1/15/2025 | 12 |
3 | 2/13/2025 | 100 |
3 | 2/20/2025 | 125 |
3 | 3/11/2025 | 123 |
4 | 3/12/2025 | 5 |
5 | 10/22/2024 | 500 |
5 | 10/24/2024 | 400 |
Intended result is to select the ID with a slicer and see performance after reopen:
ID | wk 1-4 (28days) | wk 5-8 (28days) | wk 9-12 (28 days) |
1 | |||
2 | |||
3 | 0 | 225 | 123 |
4 | |||
5 |
Metrics before re-open date could also be valuable, not sure if that is also possible
Hi @unknown917 please try this
create a calculated column in your sales table for the week buckets
And then create the measure to sum the sales based on the buckets
Sales_by_Weeks =
VAR SelectedWeek = SELECTEDVALUE('SalesData'[Week_Bucket])
RETURN
CALCULATE(SUM('SalesData'[Sales Qty]), 'SalesData'[Week_Bucket] = SelectedWeek)
Hi @unknown917
As I understand, create a RelativePeriod column that groups sales into 4-week periods before and after reopening by dividing the day difference by 28.
And the Sales_4WeekPeriod measure then sums sales for each period, allowing performance comparison over time.
Thanks, @techies -
this resulted in returning all sales for the entire date range in 2nd table. I need to be able to represent the 4 week increments, based on the go -live date
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
22 | |
10 | |
10 | |
9 | |
7 |