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

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
Memorable Member
Memorable Member

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
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.