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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
IsseBisse
Frequent Visitor

Calculated table with variable time frame

I have a bunch of transaction data like this:

DateCustomerAmount

2022-03-16

Customer A1
2022-04-16Customer B2
2022-03-18Customer A3
.........

and a table with expected sales (and more metrics) per period like this:

CustomerPeriodExpected sales per period
Customer AMonth10
Customer B

Quarter

20
Customer CYear30
Customer D  
.........

 

I want to create a report view with total sales compared to expected sales, where you can select either the current period or the previous period. How should I go about doing this? I want something like this:

  1. User selects current or previous period (with checkbox-like slicer)
  2. Based on current date and customer's "calculation period" calculate the correct dates (e.g. 2023-01-01 to 2023-01-31 if date is today and period is month)
  3. Filter transaction data based on calculated period and calculate a bunch of metrics. 

But I can't figure out how to implement it!

0 REPLIES 0

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.