Forum Discussion

ValentinLenkSBS's avatar
ValentinLenkSBS
Frequent Visitor
3 years ago
Solved

Default query names for SQL sources include schema name

What logic determines whether Power Query prepends the SQL Schema name to the automatic query names it generates, and (how) can I influence that logic?   Context: I'm querying data from an SQL sour...
  • ValentinLenkSBS's avatar
    ValentinLenkSBS
    3 years ago

    Solution for future readers: The solution is enabling hierarchical navigation when adding a data source, which is turned off by default and can be selected in that first dialog (i.e. not when later accessing that same source through "Recent Sources").

     

    In the advanced options, below the Query text field, there are a number of checkboxes, one of which is "Navigate using full hierarchy".

     

    This will require you to navigate to and expand your desired schema, but will both display the table names without the "Schema."-Prefix and accordingly generate query names without the "Schema " prefix.

     

    ----

     

    I don't care about the technical details of the query. My issue was the Query Name. From a presentation perspective "Sale" is more concise and reasonable than "consumption Sale". The "consumption" prefix is irrelevant visual clutter.

     

    Your advice is the exact opposite of the solution: hierarchical navigation is disabled by default, which causes the issue in question in the first place. Power Query's behaviour is inconsistent here, in that its name generation logic differs based on a navigation setting, with the default leading to visual clutter.

     

    However, usability is not the topic of this question, and my question has indirectly been answered. Thank you for your time.