none
Can I filter by the section name of my M-extension? RRS feed

  • Question

  • Hi there,

    I'm wondering if/how I can filter out functions who sit in my custom M-extension.

    I named the section "MyFunctions" and am wondering how I can address this and filter out functions so that only Power Queries native M-functions will be returned when using #shared. 

    Thanks,

    /Imke


    Imke Feldmann - MVP Data Platform (PowerBI) - http://www.TheBIccountant.com 

    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful - Thanks!

    Wednesday, January 30, 2019 10:00 AM
    Moderator

Answers

  • Custom connectors are compiled into the library before being linked with your document, and the original section name is effectively lost at that point.
    Tuesday, February 12, 2019 7:47 PM

All replies

  • Hi, Imke!

    If I understand your wish correctly, this formula may be helpful:

    = Record.RemoveFields(#shared, Record.FieldNames(#sections[MyFunctions]))
    Wednesday, January 30, 2019 12:57 PM
  • Thanks Aleksei,

    that's exactly what I was trying to do, but #sections doesn't return MyFunctions, so I'm getting an error: "The field "MyFunctions" of the record wasn't found.

    #sections in the query editor (in Power BI) only returns section1 containing the queries of the current workbook. So 

    Record.RemoveFields(#shared, Record.FieldNames(#sections[Section1]))

    will actually return the "clean #shared" with just native MS-functions - if there weren't any custom libraries / M-extensions. They are included in #shared and I try to find a way so exclude them to end up with a clean #shared (without having to disable my library).

    (BTW: I'm fine that this would only work in the query editor, as I'm exporting the results to csv from there.)


    Imke Feldmann - MVP Data Platform (PowerBI) - http://www.TheBIccountant.com 

    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful - Thanks!

    Thursday, January 31, 2019 9:27 AM
    Moderator
  • Hi Imke,

    May I ask how you "export the results to csv from there" ? VBA? R?

    Thursday, January 31, 2019 10:27 AM
  • Meanwhile I prefer Python: https://www.thebiccountant.com/2018/12/29/export-data-from-power-bi-to-csv-using-python/ 

    Imke Feldmann - MVP Data Platform (PowerBI) - http://www.TheBIccountant.com 

    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful - Thanks!

    Thursday, January 31, 2019 10:30 AM
    Moderator
  • Thank you
    Thursday, January 31, 2019 11:02 AM
  • Hi

    Reading Curt's comments (from 2014) on Convert text to function type I understand why #shared is not documented in Power Query M Reference. Thanks to your thread Imke I discovered another (usefull) #something.

    So I don't waste hours searching this site for other possibly exisiting #blablabla may I ask that you (#)share the other you're aware of?

    Thanks


    • Edited by Lz._ Monday, February 11, 2019 7:34 AM typo
    Friday, February 8, 2019 4:36 PM
  • In the Language specification 

    https://docs.microsoft.com/fr-fr/powerquery-m/power-query-m-language-specification

    under 2.6.4. Keywords you'll find them all:

    #binary #date #datetime #datetimezone #duration #infinity #nan #sections #shared #table #time


    Imke Feldmann - MVP Data Platform (PowerBI) - http://www.TheBIccountant.com 

    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful - Thanks!

    Sunday, February 10, 2019 7:42 PM
    Moderator
  • In the Language specification 

    https://docs.microsoft.com/fr-fr/powerquery-m/power-query-m-language-specification

    under 2.6.4. Keywords you'll find them all:

    #binary #date #datetime #datetimezone #duration #infinity #nan #sections #shared #table #time 

    Hi Imke

    Re-reading my post (where there's a little typo I'm gona fix) I understand it was a bit confusing. I know the above ones and where to find them - Thanks anyway

    I was talking about non-documented #something (other than #shared and #sections)

    Monday, February 11, 2019 7:33 AM
  • Hi,

    I trust that list of keywords to be correct, so neither know nor expect there to be any further/undocumented #somethings.


    Imke Feldmann - MVP Data Platform (PowerBI) - http://www.TheBIccountant.com 

    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful - Thanks!

    Tuesday, February 12, 2019 4:58 PM
    Moderator
  • Custom connectors are compiled into the library before being linked with your document, and the original section name is effectively lost at that point.
    Tuesday, February 12, 2019 7:47 PM
  • Thanks for clarification, Curt.

    No big deal, currently using it for a report that's going to be refreshed monthly. Just good to know that there is currently no other way than de-activating the extension.


    Imke Feldmann - MVP Data Platform (PowerBI) - http://www.TheBIccountant.com 

    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful - Thanks!

    Tuesday, February 12, 2019 8:17 PM
    Moderator
  • I trust that list of keywords to be correct, so neither know nor expect there to be any further/undocumented #somethings.


    Imke Feldmann

    Ok, Thanks Imke
    Wednesday, February 13, 2019 1:25 PM