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

Filter specific date up to current by country

Hi Community,

 

Good day. I would like to seek help on how I can filter a specific date upto latest date by Country? I have these columns: Country and Date Originated. I need to filter for example, if Country is Australia I need to filter from Oct 1 onwards, then if Country is India, Korea, SG, Vietnam, March 1 onwards, then if other countries June 1 onwards.

katerinepr_0-1656399803442.png

I have looked for possible answers but can't find it. TIA!

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

You syntax is not quite exact you need to add a formula similar to this:

= Table.SelectRows(#"Changed Type", each if  [Country] = "Australia" then [Date Originated] >= #date(2021,10,1) else if List.Contains(  {"Korea", "India", "Singapore" , "Vietanm" } ,  [Country]) then [Date Originated] >= #date(2022,3,1) else  ([Date Originated] >= #date(2022,6,1)))

Has ytou can see from the bottom table you want to get the values in green:

MFelix_0-1656603363917.png

When we apply the formula above you get the result you need:

MFelix_1-1656603388874.png

 

 

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @Anonymous ,

 

You syntax is not quite exact you need to add a formula similar to this:

= Table.SelectRows(#"Changed Type", each if  [Country] = "Australia" then [Date Originated] >= #date(2021,10,1) else if List.Contains(  {"Korea", "India", "Singapore" , "Vietanm" } ,  [Country]) then [Date Originated] >= #date(2022,3,1) else  ([Date Originated] >= #date(2022,6,1)))

Has ytou can see from the bottom table you want to get the values in green:

MFelix_0-1656603363917.png

When we apply the formula above you get the result you need:

MFelix_1-1656603388874.png

 

 

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.