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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Delete older data from Table based om reporting month

Hi All,

 

I have Historical Data coming in every month.

Report MonthBatchDateSales
1/1/2020ABC12/20/201975
1/1/2020ABC11/20/201975
1/1/2020ABC10/20/2019200
1/1/2020ABC9/11/2019200
1/1/2020ABC8/6/2019200
1/1/2020ABC7/11/201975
1/1/2020ABC6/5/2019200
2/1/2020ABC1/20/2020225
2/1/2020ABC12/20/2019225
2/1/2020ABC11/20/2019175
2/1/2020ABC10/20/2019400
2/1/2020ABC9/11/2019100
2/1/2020ABC8/6/2019100

 

Based on Report Month -> 01/01/2020 - I want to filter data only for last 3 months Dec, Nov, Oct. and delete data before that using date column.

For 02/01/2020 - Filter Data from Date column for Jan-20, Dec-19, Nov-19 and delete data before that.

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Create relationships

Capture1.JPGCapture2.JPG

Create a measure

Measure = CALCULATE(SUM('Table'[Sales]),FILTER('Table',DATEDIFF('Table'[Date],[Report Month],MONTH)>=1&&DATEDIFF('Table'[Date],[Report Month],MONTH)<=3))

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Create relationships

Capture1.JPGCapture2.JPG

Create a measure

Measure = CALCULATE(SUM('Table'[Sales]),FILTER('Table',DATEDIFF('Table'[Date],[Report Month],MONTH)>=1&&DATEDIFF('Table'[Date],[Report Month],MONTH)<=3))

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

az38
Community Champion
Community Champion

Hi @Anonymous 

for example try to create a table

New Table = FILTER(ALL(Table),
DATEDIFF(Table[Date], Table[Report Month], MONTH) <= 3 )

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.