Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Check box automatically after refresh query

Hey,

 

I Have dynamic DB that contains dates, after every time I'm updating the DB, I have to enter the PowerQuery and select the new date that have been added. Is there any way that the PowerQuery can check automatically ALL the selections every refresh?

 

Here is an example from today, where 31/8/2020 has not been selected automatically.

 

Thanks!

 

 

6 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Anonymous - I believe you want to get rid of your Filtered Rows statement,

    = Table.SelectRows(#"Unpivoted Columns", each true)

  • Jimmy801's avatar
    Jimmy801
    Community Champion

    Hello Anonymous 

     

    normaly all data is read. Could it be that you have a filter-step as last step in your query? Because this could lead into such behaviour. Could you post your query?


    If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
    Kudoes are nice too

    Have fun

    Jimmy

  • Icey's avatar
    Icey
    Community Support

    Hi Anonymous ,

     

    It is suggested to filter date column using "Date Filters", such as "After" or "Custom Filter".

     

     

    Best Regards,

    Icey

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • mussaenda's avatar
    mussaenda
    Community Champion

    Hi Anonymous ,

     

    It is better I think to use <> then your unwanted data,

    instead of = then your wanted data.

     

    So you new data will always be selected.

     

    Hope this helps!

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hey Guys, Thanks for the support,

       

      the problem is that those dates are titles, I select them after I merged another query to my data.

       

      At the editor it looks like:

       

      Table.ExpandTableColumn(#Previous Step", "Merged Data", {"KPI", "01/09/2020", "02/09/2020", "03/09/2020", "04/09/2020", "06/09/2020"}, {"KPI.1", "01/09/2020", "02/09/2020", "03/09/2020", "04/09/2020", "06/09/2020"}),

       

      What can I write instead those static dates, to select all the NEW titles?

       

      Thanks!

      • Jimmy801's avatar
        Jimmy801
        Community Champion

        Hello Anonymous 

         

        you have to make it dynamic.

        Meaning you have to analyse your column with tables and create a distinct list of all table column names, and use this list for expanding. Your new code could look something like this (not tested)

        GetDistinctListColumnNames = List.Distinct(List.Combine(List.Transform(#Previous Step"[Merged Data], each Table.ColumnNames(_)))),
        Expand = Table.ExpandTableColumn(#Previous Step", "Merged Data", GetDistinctListColumnNames , GetDistinctListColumnNames ),


        If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
        Kudoes are nice too

        Have fun

        Jimmy