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

Filter date/month satisfy complex condition

Hi

I have a table like this: 

DateCustomerAmount
15-MarC200
1-AprA100
26-MayB200
18-JunC300
13-JunA100

 

My problemn is, for each Customer, i need to know which month he bought item and also 2 or 3 months ago, he didn't buy it. If there are 2 or months satisfying same this condition, take the month closest to today. 

 

Sorry for my bad english. I tried but its very complex. Thanks for any help. 

3 REPLIES 3
v-jingzhang
Community Support
Community Support

Hi @duongan1602 

 

Currently there is no year in your sample data. To compare dates with today, you need to have Year/Month/Day for date values. 

 

In addition, how to understand the condition "also 2 or 3 months ago, he didn't buy it"? In the current sample data, customer A and C bought the item twice. Which month should be returned for them? You can provide some examples with dummy data to explain the output result. This can help us understand it better. 


Best Regards,
Community Support Team _ Jing

Ashish_Mathur
Super User
Super User

Hi,

Share some more data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
SpartaBI
Community Champion
Community Champion

@duongan1602 I created a sample file with your data and a possible way to solve this: Filter date_month satisfy complex condition 2022-07-10.pbix


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

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.