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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors