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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
RafaelAri
Helper III
Helper III

Filter dates

Hello,

I have a table of warehouse content, with "Last Transaction Date" column.

I want to add column that gives "1" for dates from more than 24 months ago and "0" for dates in the last 24 months.

I used Date.IsInPreviousNMonths but I get strange results.

See part of the table here:

Item No.Last Trans.Previous to 24
months ago
A112631/12/211
A112731/12/211
A112831/12/180
A112931/12/211
A113031/12/211
A113131/12/180
A113231/12/180
A114531/12/180
A114631/12/211
A114731/12/211
A114831/12/211
A114931/12/211
A115031/12/211
A115131/12/211
A115231/12/211
A115331/12/211
A115431/12/211
A115531/12/180
A115631/12/180
A115731/12/180
A115831/12/180
A115931/12/180
A116031/12/180
A116131/12/180
A116231/12/180
A116331/12/180
A116431/12/180
A116515/03/210
A116631/12/190
A116731/12/190
A116831/12/190
A116918/04/221
A117021/06/200
A117103/06/211
A117203/06/211
A117303/06/211
A117403/06/211
A117501/04/211
A117631/12/211
A117701/04/211
A117801/04/211
A117901/04/211
A118031/12/211
A118112/11/180
A118231/12/211
A118301/04/211
A118431/12/180
A118531/12/211
A118631/12/211
A118731/12/211
A118831/12/180
A118931/12/180
A119001/04/211
A119130/03/210
A119230/03/210
A119329/03/210
A119430/03/210
A119507/10/180
A119607/10/180
A119731/12/211
A119812/12/180
A119912/12/180
A120031/12/211
A120131/12/211
A120222/09/190
A120331/12/211
A120431/12/211
A120531/12/211
A120615/10/211
A120724/10/221
A120805/07/200
A120930/08/200
A121013/07/200
A121112/08/211
A121212/08/211
A121305/11/200
A121431/12/211
A121531/12/211
A121613/10/200
A121701/07/221
A121801/07/221
A121925/10/221
A122025/10/221
A122125/10/221
A122225/10/221
A122325/10/221
A122425/10/221
A122503/04/230
A122631/12/211
A123531/12/211
A123631/12/211
A123717/07/221
A123831/12/211
A123931/12/211
A124004/01/221
A124131/12/211
A124231/12/211
A124330/09/221
A124412/07/221
A124531/12/211
A124631/12/211
A124701/07/221
A124831/12/211
A124931/12/211
A125012/07/221
A125118/04/221
A125231/12/211
A125301/07/221
A125404/01/221
A126231/12/211
A126331/12/211
A128231/12/211
A128331/12/211
A128431/12/211
A128531/12/180
A128603/04/230
A128707/09/221
A128831/12/211
A128930/11/221
A129031/12/211
A129119/02/231
A129204/01/221
A129323/11/221
A129428/03/231
A129525/11/211
A129631/12/211
A129712/07/221
A130912/07/221
A131025/12/221
A131131/12/211
A135330/10/221
A135405/12/221
A135503/01/231
A135625/12/221
A135703/01/231
A135803/01/231
A135903/01/231
A136016/04/230
A136131/12/211
A136216/04/230
A136303/01/231
A136409/01/231
A136503/04/230
A136631/12/200
A136709/03/231
A136828/03/231
A136916/04/230
A137009/04/230
A137111/01/231
A137203/04/230
A137331/12/180
A137428/03/231
A137513/02/231
A137626/02/231
A137713/04/230
A137803/04/230
A137913/04/230
A138026/12/221
A138109/04/230
A138209/11/221
A138313/04/230
A138419/03/231
A138519/03/231
A138613/04/230
A138731/12/211
A138831/12/211
A138902/03/231
A141103/04/230
A141203/04/230
A141303/04/230
A141403/04/230
A141503/04/230
A224429/03/221
1 ACCEPTED SOLUTION
DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,

 

add a calculated column with:

 

Column = IF(DATEDIFF('Table'[Last Trans.],TODAY(),MONTH)>24,1,0)
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

View solution in original post

1 REPLY 1
DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,

 

add a calculated column with:

 

Column = IF(DATEDIFF('Table'[Last Trans.],TODAY(),MONTH)>24,1,0)
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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