cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Marck
Helper I
Helper I

How to show data from specific date range?

Hello,

 

I have two groupings  cities names 1 and cities name 2.  And i would like to create a filter for which if date is equal or greater to the  earliest date available in the data source and  before to the 15/01/2021  then show cities 1 else show cites 2.

 

 

Somone can help me in this?

 

Thank you in advance

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Marck , you can add a calcualted column to create a group.

Column = IF([Date]<DATE(2021,1,1),[Country group],[City])

021803.jpg

Regards,
Jing
If this post helps, please consider Accept it as the solution to help other members find it.

View solution in original post

7 REPLIES 7
nandic
Super User II
Super User II

Hi @Marck ,
Attached demo file. 
My demo file: Main table has columns date, city1, city2, amount. Another table is date table.

VAR _selectedDate =
    SELECTEDVALUE ( 'Table'[Date] )
VAR _City1 = MIN ( Sales[City1] )
VAR _City2 = MIN ( Sales[City2] )
RETURN
    IF ( MIN ( Sales[Date] ) < _selectedDate_City1_City2 )

Result:

 

cities.PNG

 

Regards,
Nemanja Andic

Shishir22
Resolver II
Resolver II

Hello @Marck ,

 

Request you to please provide some sample data and expected result.

 

Thanks!

Hi I am not sure why I can not upload a table with a sample data as i am receiving an error message. However my goal is use a grouping called states if the date is >= 01/01/20019 and <1/01/2021 while using city names if the date is >1/01/2021

v-jingzhang
Community Support
Community Support

Hi @Marck , you can upload your sample data to some cloud storage services like OneDrive, GoogleDrive, Dropbox... make it public and share the link here. Remove sensitive info before sharing.

Hello,

 

Please find attached the link to the  sample data https://docs.google.com/spreadsheets/d/1Oa5DZHpIgFsy_tK2gterS6Nx3XEn7HD92AfQbdkVH2Y/edit?usp=sharing

My aim is to create group for which if date is > or = to 01/01/2019 and <1/01/2021 then use Country group else if date is >1/01/2021 use City

 

v-jingzhang
Community Support
Community Support

Hi @Marck , you can add a calcualted column to create a group.

Column = IF([Date]<DATE(2021,1,1),[Country group],[City])

021803.jpg

Regards,
Jing
If this post helps, please consider Accept it as the solution to help other members find it.

View solution in original post

Thank you for your help

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

April Update

Check it Out!

Click here to read more about the April 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.