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

Filter to sales from same address within 14 days

Hi everyone,

 

I have a database with a field for 'customer address' and a field for 'sales date'. I've been asked to put something together that filters any instances where we record 2 or more sales from the same address within 14 days - can anyone advise the best way to put this together please? Is this something that could be done in an initial power query or requires additional columns/measures?

 

Thank you! 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , you can rolling 14 days measure

Rolling 14 = CALCULATE(countrows(Table),DATESINPERIOD('Date'[Date],max('Date'[Date]),-14,DAY))

 

And create a measure check how many address more than one rows in last 14 days

MT 1= countx(filter(summarize(Table, Table[customer address], "_1", [Rolling 14] ), [_1]>1),[customer address])

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi thanks for this wonderful solution, it is great. 

 

How would be best to present the data within a table? Ideally I would like a table with a slicer so people can select date and then within the table it shows (for example) all details for BOTH sales within a 14 day period rather than just the last one?

 

Thank you! 

amitchandak
Super User
Super User

@Anonymous , you can rolling 14 days measure

Rolling 14 = CALCULATE(countrows(Table),DATESINPERIOD('Date'[Date],max('Date'[Date]),-14,DAY))

 

And create a measure check how many address more than one rows in last 14 days

MT 1= countx(filter(summarize(Table, Table[customer address], "_1", [Rolling 14] ), [_1]>1),[customer address])

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.