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

October 28 & 29: Experts share their secrets on how to pass the Fabric Analytics Engineer certification exam—live. Learn more

Reply
RafaelAri
Helper II
Helper II

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
Super User
Super User

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
Super User
Super User

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

October NL Carousel

Fabric Community Update - October 2024

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