Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

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

  • Hi Anonymous , you can add a calcualted column to create a group.

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

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

7 Replies

  • Hello Anonymous ,

     

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

     

    Thanks!

    • Anonymous's avatar
      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

      • v-jingzhang's avatar
        v-jingzhang
        Community Support

        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.

  • nandic's avatar
    nandic
    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:

     

     

    Regards,
    Nemanja Andic