Forum Discussion

nirrobi's avatar
nirrobi
Helper V
10 years ago
Solved

get data - load data base on date filter

Hi,

 

I have HUGE table that I load to my model (and workproperly).

I want to add line in my sql to load only data the date is greater then 31/12/12

 

I succeed to do it in excel query but get error in power BI.

 

This what I tried:

TableName.CulomnName>{ts '2012-12-31 00:00:00'}

 

please your help

  • Hi,

     

    When connecting to MySQL, you can provide a custom SQL statement where you can provide this Date filter.

     

    Alternatively, you could connect to MySQL without a SQL statement, which will let you navigate to the table in question. Once you select the table, click Edit and this will bring you into the Query Editor experience. You can define filters based on Date columns within the Query Editor without the need to learn or write SQl statements. These filters can be static dates or dynamic (i.e. This Week, This Month, Year To Date, etc.).

     

    Thanks,
    M.

4 Replies

  • mllopis's avatar
    mllopis
    Community Admin

    Hi,

     

    When connecting to MySQL, you can provide a custom SQL statement where you can provide this Date filter.

     

    Alternatively, you could connect to MySQL without a SQL statement, which will let you navigate to the table in question. Once you select the table, click Edit and this will bring you into the Query Editor experience. You can define filters based on Date columns within the Query Editor without the need to learn or write SQl statements. These filters can be static dates or dynamic (i.e. This Week, This Month, Year To Date, etc.).

     

    Thanks,
    M.

    • nirrobi's avatar
      nirrobi
      Helper V

      Hi. 

       

      What is the syntax for filter data from year 2013 and after?

      Thanks

    • Mussa's avatar
      Mussa
      New Member

      Hello There,

       

      Need your help.

      When I'm loading the MySQL table in Power BI, I only have 'Load' or 'Transform data' options and I do not see edit. I want to pull the data only from last month as this MySQL table consists of many years of data.

       

      In addition, when I load the above data, the Power BI does not recognize the date and it is showing mm/dd/yyyy whereas, my laptop date format is dd/mm/yyyy. I can't change my laptop date format since it is linked to many other systems.

       

      Please advise,

      Thank you