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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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

Hi @Anonymous , 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
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,
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
Solution Sage
Solution Sage

Hello @Anonymous ,

 

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

 

Thanks!

Cheers,
Shishir
Anonymous
Not applicable

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

Hi @Anonymous , 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.

Anonymous
Not applicable

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

 

Hi @Anonymous , 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.

Anonymous
Not applicable

Thank you for your help

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.