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

identify policies within last 12 months

Hi,

 

I have a table which contains all live policies from our database, which has a column with the policy craete date.  I am trying to create a column that identifies whether a policy was created within 12 months from today's date. 

 

In short, I need to see if a policy was created within the last 12 months, then this is classed as 'New Business', if not, then this will remain blank.

 

Is this possible?

 

Thanks.

2 ACCEPTED SOLUTIONS
Phil_Seamark
Employee
Employee

Hi @Anonymous

 

You can add a calculated column in yoru policy table along the following lines

 

Policy Live =IF('Table1'[Date]>TODAY()-365,1,0)

Which you can then use as a filter.  You don't have to use 1/0 either.  You can subsitute with text if you prefer "live" / "not live"

 

or use the BLANK fuction instead of the 0


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

v-sihou-msft
Employee
Employee

@Anonymous

 

You can also try Power Query approach. Just add a custom column using Date.AddMonths() function in Query Editor.

 

88.PNG

 

89.PNG

 

Regards,

 

 

View solution in original post

3 REPLIES 3
v-sihou-msft
Employee
Employee

@Anonymous

 

You can also try Power Query approach. Just add a custom column using Date.AddMonths() function in Query Editor.

 

88.PNG

 

89.PNG

 

Regards,

 

 

Phil_Seamark
Employee
Employee

Hi @Anonymous

 

You can add a calculated column in yoru policy table along the following lines

 

Policy Live =IF('Table1'[Date]>TODAY()-365,1,0)

Which you can then use as a filter.  You don't have to use 1/0 either.  You can subsitute with text if you prefer "live" / "not live"

 

or use the BLANK fuction instead of the 0


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

spuder
Resolver IV
Resolver IV

Hi,

 

you can try to use Power Query for that job.

 

example.jpg

 

There is an equivalent in DAX for that.

 

calculated column 

 

check = if(DATEADD([createdate],-1,year)>=1,"new business","")

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.