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
MF_BI
Regular Visitor

Flag Period

Hello all,

 

I have this kind of table below : 

Order date idfirst use date 
11/01/2021 15:18id111/01/2021 10:11
11/01/2021 10:11id111/01/2021 10:11
12/01/2021 12:53id111/01/2021 10:11
09/02/2021 15:18id111/01/2021 10:11
15/03/2021 14:54id111/01/2021 10:11
15/04/2021 14:37id111/01/2021 10:11
17/05/2021 10:42id111/01/2021 10:11
01/06/2021 12:16id111/01/2021 10:11
07/01/2021 08:53id207/01/2021 08:53
06/02/2021 11:47id207/01/2021 08:53
11/03/2021 11:16id207/01/2021 08:53

 

and I want to add column with Flag, that indicate by users id if the order date is in the first month after first use (First use date+30days), or in the second the seconde month(Between First use date+30 and First use date+60), or in the third month(Between First use date+60 and First use date+90),etc... as the table below : 

Order date idfirst use date Flag
11/01/2021 15:18id111/01/2021 10:11M1
11/01/2021 10:11id111/01/2021 10:11M1
12/01/2021 12:53id111/01/2021 10:11M1
09/02/2021 15:18id111/01/2021 10:11M1
15/03/2021 14:54id111/01/2021 10:11M3
15/04/2021 14:37id111/01/2021 10:11M4
17/05/2021 10:42id111/01/2021 10:11M5
01/06/2021 12:16id111/01/2021 10:11M5
07/01/2021 08:53id207/01/2021 08:53M1
06/02/2021 11:47id207/01/2021 08:53M1
11/03/2021 11:16id207/01/2021 08:53M3

 

Thank you for your help. I appreciate that.

 

Best,

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@MF_BI Try:

Flag Column = TRUNC(DIVIDE(([first use date] - [Order date]) * 1.,30))+1

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

@MF_BI Try:

Flag Column = TRUNC(DIVIDE(([first use date] - [Order date]) * 1.,30))+1

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thank you @Greg_Deckler 

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.