Write Your First CUSTOM M FUNCTION in Power BI

Sdílet
Vložit
  • čas přidán 7. 07. 2024
  • In this video I show how to write your own custom M FUNCTIONS in Power BI. It will enable you to do work more efficiently in the query editor (Power Query).
    Download file here datatraining.io/powerbi-how-to
    --------------------------------
    📊 TRAININGS 📊
    ---------------------------------
    Power BI Design 4 Weeks Transformation Program my.datatraining.io/pages/powe...
    Power BI Essentials datatraining.io/powerbilearni...
    Business User Training datatraining.io/powerbi-busin...
    For Custom Trainings and Consulting email directly support@datatraining.io
    ---------------------------------
    ⏱️ TIMESTAMPS ⏱️
    ---------------------------------
    0:00​ Intro
    1:08 Write your first custom M Function
    2:35 Different ways to invoke a function
    3:46 Assigning a data type to the input parameters
    4:43 Adding multiple input parameters and transformations
    7:48 Understanding how Power Query executes M Functions
    9:14 Are M Functions really necessary?
    11:12​ End
    ---------------------------------
    😍 JOIN 😍
    ----------------------------------
    Join bit.ly/4b453bi
    Subscribe bit.ly/31MnQGO​
    Insta / howtopowerbi
    LinkedIn / basdohmen
    TikTok / how.to.power.bi
    X / howtopowerbi
    fb / howtopowerbi
    Threads www.threads.net/@howtopowerbi
    Newsletter datatraining.io/newsletter
    ---------------------------------
    👇 CHECK THIS OUT! 👇
    ---------------------------------
    💻 My gear amzn.to/47F21Yc
    📚 Power BI books MUST READ! amzn.to/3tUfFcj
    💡 General books I recommend amzn.to/48YNo33
    🎶 Music for my videos www.epidemicsound.com/referra...
    🚀 For growing on CZcams: www.tubebuddy.com/bas
    🏄 Stuff I use daily amzn.to/3HqfMQ2
    * Above are affiliate links, which means at no additional cost to you, if you make a purchase using these links we will receive a small commission. It supports us and helps us to continue making more How to Power BI videos!
    Thanks for being a part of this channel and all your support! 💪 🙏
    #HowToPowerBI​ #PowerBI​ #DataTraining​
    #powerbidesktop​ #powerbitraining​ #powerbideveloper​ #DAX
  • Věda a technologie

Komentáře • 44

  • @elijahphilson8878
    @elijahphilson8878 Před 2 lety +4

    This is a very well made video! Crisp explanations, well thought out content, intro/body/conclusion, great editing, and the quiet jazz in the background made me want a coffee all the more! Oh, and to practice writing m functions :)

  • @juanlauroaguirre5646
    @juanlauroaguirre5646 Před rokem

    Hey Bas, the way you explain is just SUPERB, thanks a LOT!!!

  • @AbouAli01006300091
    @AbouAli01006300091 Před rokem +4

    SUPER SUPER SUPER LIKE!!!!... You made it easy .. I was completely afraid to touch this area but you really made it easy!
    Very well done

    • @HowtoPowerBI
      @HowtoPowerBI  Před rokem

      Awesome Mohammad :) im very happy you think so!

  • @dennydavise
    @dennydavise Před rokem +1

    I follow the second group Baz. Very nice video... hats off to you...

  • @rajkumarrajan8059
    @rajkumarrajan8059 Před 3 lety +1

    Excellent Tip. Make the data model more efficient

  • @user-bk8db7ud6k
    @user-bk8db7ud6k Před 2 lety

    Great example, thanks.

  • @partymaschine92
    @partymaschine92 Před 2 lety

    Of course I am in the second group as well, this is an awesome example of how custom functions are working! thank you very much for this video!!
    I like your dialect - is this a dutch dialect?

  • @kishore_p93
    @kishore_p93 Před 3 lety +1

    Very useful tip! Thanks for sharing Bas! Love the way you explain ☕

  • @malvin74s
    @malvin74s Před 10 měsíci

    Right on point! Thank you.

  • @SamehRSameh
    @SamehRSameh Před 2 lety +3

    Please create special playlist for m language from beginner to advanced

  • @shawnh2446
    @shawnh2446 Před 2 lety

    Absolutely love your videos 👍

    • @HowtoPowerBI
      @HowtoPowerBI  Před 2 lety

      Thank you sooo much Shawn :) You made my day

  • @louism.4980
    @louism.4980 Před 2 měsíci

    Thank you so much, Bas! Love how you've made it so simple! A quick question, is the performance better using custom function? I.e., if I were to refresh the query, will both methods take pretty much the same amount of CPU time? Thanks agian.

  • @williamarthur4801
    @williamarthur4801 Před rokem

    Good video,iit all looks so eay when other people do it., I find custom function syntax quite tricky, as in.
    ( A , B )=> A + B
    or
    let
    Addup = (A, B ) =>
    A + B
    in
    Addup
    and that's before you start needing nested let / in statements.

  • @vlockmedia
    @vlockmedia Před rokem

    clear, thank you

  • @charlesd820
    @charlesd820 Před 3 lety +1

    Excellent Info, Many thanks

  • @samirvaghasiya9918
    @samirvaghasiya9918 Před 2 měsíci

    Thanks :) Very useful

  • @user-ef4oc3vc6r
    @user-ef4oc3vc6r Před 2 lety

    Thanks

  • @DanielTavares29
    @DanielTavares29 Před 3 lety

    Very nice video!!
    I prefer the second one 😅👍

    • @HowtoPowerBI
      @HowtoPowerBI  Před 3 lety

      hahaha me 2 ;) especially in the morning 😂

  • @AlbrechtJ
    @AlbrechtJ Před rokem

    Thanks for a helpful video. Subscribe already.

  • @HansdeCocq
    @HansdeCocq Před 2 lety

    Nice trick but……..do you store those functions in a kind of library/repository? E.q how do you make those functions maintainable including the different versions ?
    ?

  • @nagaprasanthsn1184
    @nagaprasanthsn1184 Před 11 měsíci

    Hello, I have a scalar valued function in SQL. I need to pass SUM of certain columns from Power BI to get a final result which needs to be displayed. May I know how to achieve that?

  • @beenaprasad5815
    @beenaprasad5815 Před 3 lety

    Hi is there any to render custom font on client computer without installing that custom font to there pc or laptop .plz show me a way need help 🆘🙏🙏

  • @thebhaskarjoshi
    @thebhaskarjoshi Před rokem

    7:12 Thinking... How to make second petameter as Optional?

  • @DinoAMAntunes
    @DinoAMAntunes Před 3 lety

    Hi Tks, can you provide a example with multiple tables as parameter.

    • @HowtoPowerBI
      @HowtoPowerBI  Před 3 lety +1

      🙂 yes, will do in one of my next videos

  • @bryanchaves5691
    @bryanchaves5691 Před 3 lety +1

    Hey bro, lets say I have a column with emails. Is it possible to filter by default the data based on who logs in without RLS? Maybe using a calculated table??

    • @HowtoPowerBI
      @HowtoPowerBI  Před 3 lety +1

      tricky one, maybe you could build a table with users / roles / entitlements and create an inactive relation and then active it in your dax measures. I don't know of a more elegant way of solving it.

    • @timgray7859
      @timgray7859 Před 3 lety +1

      What you describe is exactly the point of RLS. It's relatively easy. Set up a security role with the email column = USERPRINCIPALNAME(). If the user does not appear in the email list, everything will be filtered out.

    • @bryanchaves5691
      @bryanchaves5691 Před 3 lety

      Thanks, what Im looking for is more a default filter so users can see other's information but displaying theirs by default

  • @agustinpena948
    @agustinpena948 Před rokem

    why the M code does not follow a sequential order? I find it hard to understand. thanks!

  • @Random_channel_2023
    @Random_channel_2023 Před 6 měsíci

    This is quite confusing for a brand new person and I'd like to advise why instead of just leaving it at that. Every time a new query or function is shown, there is nothing showing how is related to the table. The table already had the 'strength' and 'nrbeans' value, but that wasn't advised of when the functions or invokes were being displayed, therefore I'm trying to understand if when the variables are shown are they referencing the column names from the table or are they new variables. Very lost due to that one detail.

  • @venkatareddykummitha5863

    How to add 2 numeric columns using custom column in POWER QUERY EDITOR.

  • @raitup00
    @raitup00 Před 2 lety

    Team Calculeted column

  • @johnnywinter861
    @johnnywinter861 Před 3 lety

    Nice explanation... But do barristas really count the beans?! 😝

    • @HowtoPowerBI
      @HowtoPowerBI  Před 3 lety +1

      haha 😂 , the ones that have seen this video will! Don't be surprised next time you visit starbucks