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
bansikpopat
Frequent Visitor

Applying filter on specific column

 

1. I extract sales data every 7 days from SAP into excel. I feed this excel as input for powerBI.  

2. I created a table with several columns from different data sources to see information about sales order -->I call this as current week sales order table. 

3. I used a date slicer for the current week table. The date slicer range is always 

Start date : 01/01/2021 and End date : the day I extract the data. 

 

4. In my table there is a column where I want to apply specific filter of date range. This column is coming from previous week sales order table. The date range is 

Start date : 01/01/2021 and End date :  7 days before the end date used in date slicer for the table (end date from point 3)

 

I am trying to use below formula. I do not know what to use in place or question mark. I do not want to use today()-7 because what if there is a gap of few days or weeks due to any reasons. I want to see the difference in quantity of sales order for current week vs. previous week. 

 

Count of previous week sales order = Calculate(SUM(preweek[sales order]), FILTER(preweek[date]>=01/01/2021 && preweek[date]<=???))

 

Sample date to explain better : 

 

Current week table :

Start date : 01/Jan/2021 to End date : 01/Feb/2023 

MaterialSum of sales order
513125
122120
135153

 

Previous week table : 

Start date : 01/Jan/2021 to End date : 25/Jan/2023 

 

MaterialSum of sales order
513150
122110
22105

 

 

Resultant table 

Start date : 01/Jan/2021 to End date : 01/Feb/2023

 

MaterialSum sales order (current week)Sum sales order (previous week) - this will be a calculated column with date filter - 01/Jan/2021 to 25/Jan/2023
51312550
12212010
135135null

 

 

Can anyone please help? Trying to find a solution for one week. 

 

Regards,

Bansi 

1 REPLY 1
jbwtp
Memorable Member
Memorable Member

Hi @bansikpopat,

 

May be something like preweek[date]<= MAXX(current_week, [date]) - 7?

 

Cheers,

John

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.

Top Solution Authors