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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Filtering years after a specific past date

HI,

I have a range of customers that have made their first purchase at dates varying from 1951-2015. What i would like to is to measure their events and actions the first two years after their first purchase.  Is there an easy way to filter the two following years from the first purchase-date?

Really thankful for any help. 

5 REPLIES 5
Anonymous
Not applicable

You can use the below formula for your measure:

 

First two years=
Var Date1 = EDATE(Min(TransactionTable[Date].[Date]),24)
Return
CALCULATE(SUM(TransactionTable[Sales Amount]),
FILTER (TransactionTable,TransactionTable[Date] >= MIN(TransactionTable[Date])&& TransactionTable[Date] <= Date1))
 
hope this helps
Anonymous
Not applicable

Hi Yazidh

Thanks for your response.

I'm not getting it to work. Do you know if its possible to only use a filter for example. Where a measure is EDATE(FirstPurchasedate;24) or similar and applies to all customers in table?

Thanks again!

Anonymous
Not applicable

do you want the raw transactions to show as per the requirement above? or you want to aggregate a certain value for each customer? as the formula i sent would cover the latter

 

would it be possible to share some dummy data and elaborate on what you want?

Anonymous
Not applicable

Hi,

The raw transactions would be fine, there are alot of other events  and values that i also would like to measure beside sales, as long as i can limit them to the first 2 years after initial purchase. 

I'll see if i can sort some dummy data. thank you so much Yazidh!

Hi @Anonymous ,

Have you solved the problem?

If you have solved, please accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

If you still need help, please share your data sample which could reproduce the scenario and the desired output so that we could help further on it.

Best  Regards,

Cherry

 

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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