Intro to Python in Power BI

Поділитися
Вставка
  • Опубліковано 29 чер 2021
  • Using Python and curious how to use it with Power BI? Patrick explores how you can do just that! Python + Power BI can be a powerful combination.
    Power BI Python documentation:
    docs.microsoft.com/power-bi/c...
    Seaborn Tutorials:
    seaborn.pydata.org/tutorial.html
    📢 Become a member: guyinacu.be/membership
    *******************
    Want to take your Power BI skills to the next level? We have training courses available to help you with your journey.
    🎓 Guy in a Cube courses: guyinacu.be/courses
    *******************
    LET'S CONNECT!
    *******************
    -- / guyinacube
    -- / awsaxton
    -- / patrickdba
    -- / guyinacube
    -- / guyinacube
    -- guyinacube.com
    **Gear**
    🛠 Check out my Tools page - guyinacube.com/tools/
    #PowerBI #Python #GuyInACube
  • Наука та технологія

КОМЕНТАРІ • 228

  • @nickie2222
    @nickie2222 2 роки тому +36

    I've been using Python for years and I'm totally new to Power BI, I don't think I can do what I wanted in Power BI, but I watched the whole of the video anyway because it's such a well done video!
    Also, as Python-fan, watching your enthusiasm made the video even better

    • @ankit_real
      @ankit_real Рік тому

      How much package do you get??

  • @lespinoz
    @lespinoz 3 роки тому +11

    Wow...!!! How simple to implement Python you just showed here! Congrats and thank you for sharing!
    Aside from that, I liked the way you edited your video; audio, zooms, highlighting, story flow... just amazing!

  • @alicedwonderland7733
    @alicedwonderland7733 2 роки тому +4

    Thank you, Patrick! I'm toying with the idea of starting with Python, and I love Power BI, hence I need to mix them. You rock!

  • @JR-ly6bx
    @JR-ly6bx 3 роки тому +2

    probably the best tutorial on youtube ive ever seen, awesome job

  • @mbulelolomo8898
    @mbulelolomo8898 3 роки тому +2

    Thank you for this Patrick, I am actually starting with learning python. Great video you have right there!

  • @Anthony_Lecoq
    @Anthony_Lecoq 3 роки тому +3

    Awesome Patrick ;) I was thinking to test python in PBI since a while. This video made me started... I though it would be a bit complicated, but I am astonished by the simplicity to implement it. Time invested versus the quality and powerfulness of charts. It is definitely worth it. And using data=dataset ... BAM we get the interactivity between charts... For the moment I do not use any service so no issue with the Gateway... I feel I will find out some great usage of python in PBI ;) Patrick you are amazing ! Merci

  • @WAIT4GOD
    @WAIT4GOD 7 місяців тому

    Awesome, thanks for taking the time to do this!

  • @jhewitthunt
    @jhewitthunt 3 роки тому +1

    Perfect starter video for a total amateur like me! Thanks Patrick

  • @tomasdale5306
    @tomasdale5306 2 роки тому +1

    I HAVE NEVER SEEN SOMEONE WITH SO MUCH ENERGY TEACHING !!!!

  • @mimibyrd5403
    @mimibyrd5403 Рік тому

    This video was excellent and allowed me to get started with Python in my Power BI report.

  • @AAzert42
    @AAzert42 3 роки тому +3

    Nice, thanks for this video ! Hope to have more video about Python integration in Power Bi in future videos

  • @Darksirius155
    @Darksirius155 3 роки тому +2

    Please more Video like this, always amazing videos.

  • @ShabnamKhan-vk7fj
    @ShabnamKhan-vk7fj 2 роки тому

    You rock! thanks for the quick demo. I love it

  • @josez2544
    @josez2544 6 місяців тому

    That's how you really teach something, rigth in the moment you are learning it yourself. Thanks

  • @tarun007
    @tarun007 3 роки тому

    Thanks Patrick. This was a good start.

  • @elrevesyelderecho
    @elrevesyelderecho 3 роки тому

    Thanks. Good intro to the subject!

  • @AmitRoy-om3tp
    @AmitRoy-om3tp 3 роки тому

    This is great! I will try this out.

  • @CyrilGagnaire
    @CyrilGagnaire 3 роки тому

    Hoooo, I need to try that! Thanks Patrick

  • @luishernando
    @luishernando 2 роки тому

    Thanks a lot Patrick! Smooth and very useful orientation! Python and PB! awesome! The best of all the world

  • @jayong2370
    @jayong2370 Рік тому +1

    Great video. Just starting to explore using Python with Power BI. Interesting to see how the performance of the python queries stack up against DAX.

  • @Embargo27
    @Embargo27 2 роки тому +1

    This was phenomenal, bro u just made my life a lot easier

  • @sinatabar
    @sinatabar 3 роки тому

    Awesome, cool video. Explaining all the details 👍

  • @g.alanmackey7766
    @g.alanmackey7766 3 роки тому

    Great demo! Thanks much,

  • @CarlosHernandez-dh7zn
    @CarlosHernandez-dh7zn 3 роки тому +24

    The video in 6:11 set "matplotlib.pyplot as lib" and launch "pit.show". That's an error. The right code is: (after install pandas and anaconda)
    import seaborn as sns
    import matplotlib.pyplot as pit
    sns.swarmplot(x="day", y="total_bill", data=dataset)
    pit.show()

  • @saketsrivastava84
    @saketsrivastava84 2 роки тому

    Brilliantly explained

  • @atarunraj
    @atarunraj 3 роки тому

    Yup. Have used Python to extract data from Oracle ERP Cloud to use with Power BI. Never did the visualization though, so that was good to see. 👍

  • @matthiask4602
    @matthiask4602 3 роки тому +1

    Good "Intro". Makes one eager to learn more about python in Power BI . But more content on top of this is to be expected now. :-)

  • @pjevans793
    @pjevans793 3 роки тому

    Great stuff man... Would love to see some videos over the GenerateEmbedTokenV2 changes and what new functionality comes with the newer embed token model. Really the main updates with the move to V2.

  • @yukithejapanese
    @yukithejapanese 3 роки тому +1

    I've already use Python integration for some of my freelance work and it's great!

  • @JHatLpool
    @JHatLpool 2 роки тому

    A really useful guide.

  • @davey1644
    @davey1644 2 роки тому

    Slick - Thanks Patrick !!

  • @daw70772
    @daw70772 2 роки тому

    Thanks! Very helpful!

  • @followrajah7743
    @followrajah7743 3 місяці тому

    Patrick thank you for this. Just yesterday I wanted to use Python in Power BI but had no idea where to start.

  • @DavidSanchez-vr1ny
    @DavidSanchez-vr1ny 2 роки тому

    This was pretty cool!

  • @ArmandoReportes
    @ArmandoReportes 3 роки тому +1

    Another reason to learn python. Thanks.

  • @cristovamramosneto3068
    @cristovamramosneto3068 3 роки тому

    Thank's for this video!

  • @mraa4950
    @mraa4950 3 роки тому

    Very informative!

  • @jasons6721
    @jasons6721 3 роки тому +2

    Appreciate you posting this info! Very informative and something I was looking for.
    However, I've been trying to figure out the compelling use case to use python. So far, I can do everything that I've need with OOB connectors, dax and mquery.
    But, I've seen that doing some development using Python (specifically in Jupyter Notebook) is much quicker because you only deal with a small subset of data instead of loading the entire data set.
    In some cases, where data load time becomes an issue, i just set parameters to only load recent files or a # of records... Then, let data refresh do the heavy lifting after publishing.

  • @simon123cup
    @simon123cup 3 роки тому +27

    Patrick is a legend.

    • @paulj625
      @paulj625 3 роки тому

      Damn right boy!!!

  • @karinahulka1486
    @karinahulka1486 Рік тому

    thanks for the video

  • @Noel72317
    @Noel72317 3 роки тому

    Hello patrick, I from Nicaragua and don't speak english but this video have subtitle in spanish, so great .. thank you for that
    could you continue placing the subtitles?

  • @jdgh86
    @jdgh86 3 роки тому

    Awsome thanks!

  • @user-lx4hx2yy9k
    @user-lx4hx2yy9k 3 роки тому

    Thanks! Cool Video

  • @jedidiaholadele2086
    @jedidiaholadele2086 2 роки тому

    Loved this!!
    Watching him alias matplotlib as lib was quite funny though 😂

  • @foxusmusicus2929
    @foxusmusicus2929 3 роки тому

    Wow thank you for the video. Please more :-)
    Thanks to you this stuff is actually interesting and motivates to do more :-)

  • @jankruit6089
    @jankruit6089 Рік тому

    Liked your video! I am A Python and Power BI Teacher: Very good as a start!

  • @SpiritOfIndiaaa
    @SpiritOfIndiaaa 2 місяці тому +1

    thanks a lot , where from the data set of "tips" came from ?

  • @klaymoon1
    @klaymoon1 Рік тому +1

    Great video! Can I ask you what is Personal Gateway? Is it something download and install or subscribe to? Thanks.

  • @szklydm
    @szklydm 3 роки тому +10

    Just out of curiosity, how long did it take you to figure all this stuff out? 🙂
    Great to see the "masters" struggle a bit, which is an inevitable part of the learning curve.
    Thanks for this Patrick!

  • @xxczerxx
    @xxczerxx Рік тому +1

    This is really neat. I was wondering if you could use Python in Power Query at the "source" level to handle folders that have constantly updating information (eg files that have current date in their name)? Does this eat into memory usage or is it still "technically" operating within Python (ie outside M)?
    I had this problem previously -- a folder on SharePoint that had files being continuously added. I couldn't figure out a way for the Query to update dynamically. So I couldn't figure out a simple logic in M to simply say ("import everything in this folder with string containing 'xxx' ").
    However, after watching this vid it seems you could simply write a simple Python script to handle that batch import with necessary logic.

  • @jacekgatkowski8869
    @jacekgatkowski8869 Рік тому

    Great Video and python skills ;)

  • @jimmytao2505
    @jimmytao2505 3 роки тому

    Amazing, how could you make the blue square move along with your mouse in your video?

  • @rohandhande9391
    @rohandhande9391 3 роки тому

    This guy's are amazing why Microsoft not seen this channel .

  • @user-sj9xq6hb9p
    @user-sj9xq6hb9p 3 роки тому

    We need a full series

  • @javiergonzales6118
    @javiergonzales6118 3 роки тому

    Hey Patrick. Neat video. Are the python visuals supported in Power BI service? I noticed you mentioned this only works with a personal Power BI gateway. Doesn't it work with Enterprise gateway? Thanks

  • @NayankaGothane
    @NayankaGothane 3 роки тому +2

    When we work on R and Python visual, it kinda takes lot of load on pbix file. How to optimize the same?

  • @willcisler7069
    @willcisler7069 3 роки тому +62

    I love the R and Python integration in power query but, for me, the personal gateway is the deal breaker. We have an enterprise gateway but that doesn't work. I could install the personal gateway on the same machine but now I have two gateways to update and configure.. :(
    Is it worth stating that the gateway isn't required for the visualisations as along as you use the support packages.

    • @markmathieu8648
      @markmathieu8648 3 роки тому +3

      Will, absolutely. I was let down alot early on in my PowerBI journey when I'd go to implement python outside of visualizations and just get crushed by the lack of support in enterprise gateway.

    • @ssudarshan75
      @ssudarshan75 3 роки тому +7

      Quite funny! Just before the video started, the first thing i did was to scroll down hoping that we dont need a personal gateway and here's the comment. This is a deal breaker

    • @ThoughT73
      @ThoughT73 3 роки тому +1

      Same here. Total deal breaker.

    • @daviddossantos5629
      @daviddossantos5629 3 роки тому

      Looks cool but no even going to try because it's not efficient the way to get the data, we use live connection (SSAS).

    • @ducminh7568
      @ducminh7568 3 роки тому +1

      wait can we just upload the script on OneDrive and then use it ?

  • @paulnandes2841
    @paulnandes2841 3 роки тому +12

    Python for REGEX to validate data quality of a database and then Power Automate to email the users inpuiting bad quality data so they can fix.

    • @FaaBioo972
      @FaaBioo972 3 роки тому

      Great use case 👍🏾

  • @jsorrisone
    @jsorrisone 2 роки тому

    bro man bro.....you are legit the most solid doo in the cuooo

  • @SK-ck3qb
    @SK-ck3qb 3 роки тому +1

    How can I use this with Analysis Services in an emedded app? Thanks!

  • @naman.sapra.12
    @naman.sapra.12 3 роки тому

    Hi Patrick, can we perform Text Analytics using Python visual in Power BI? If our data is based out of SSAS so we won't be able to use Text Analytics as we won't have Query Editor in Power BI then due to Analysis Server based data source.

  • @abimaeldominguez4126
    @abimaeldominguez4126 2 роки тому

    Hello, thanks for the video. I have a question, I was wondering if this Python scripting would work when I upload my dashboard to the cloud and update it using a gateway to refresh the data sources periodically?

  • @josephdaquila2479
    @josephdaquila2479 5 днів тому

    Do you think this would be effective at defining custom logic for bringing in data?
    Like having to loop through the dataframe to determine its structure?
    and returning that dataset?
    stuff that you cant do just through applying transformations & such...

  • @n0rice4u39
    @n0rice4u39 2 роки тому +1

    Hey Patrick, not sure if this is mentioned but in the command line you dont have to put the full directory of python, just "python -m pip install.." is good enough

  • @aswinshukla5762
    @aswinshukla5762 8 місяців тому

    Any idea if we can use python in PBI Q&A feature ? I want to enhance the Q&A feature by adding some NLP api's.

  • @xtiandyc7034
    @xtiandyc7034 Рік тому

    Hi Patrick! I'm planning to learn power bi right now. can you give me the link from your videos where I can start with? You got tons of videos and I don't know what video to start with. Thanks!

  • @klamentyne5991
    @klamentyne5991 2 роки тому

    More of the python in power bi please!

  • @LuisRomaUSA
    @LuisRomaUSA 3 роки тому +28

    Python visuals are very slow once the report is published, to slow to be actually used in a report. To my understanding, this is because the script has to be sent back to an azure host that recalculates the visual each time you change it. I try avoiding python visuals in power bi for this reason

    • @sharkam69
      @sharkam69 3 роки тому +11

      The only way that your report is not slow is an empty report

    • @thefamousdjx
      @thefamousdjx 2 роки тому

      Good info

  • @goldensleeves
    @goldensleeves 2 роки тому

    Great video.
    What is a personal gateway???
    Also, I am surprised it’s such a short list of supported python packages… I wish plotly was supported for example!

  • @36DENSE36
    @36DENSE36 Рік тому

    Are there any plans to also make Python available for the standard mode of the power bi gateway (so not the personal mode)?

  • @tadsaitsaac7547
    @tadsaitsaac7547 3 роки тому

    we can do manipulations on the table we impprt to data query with python?

  • @leybourne
    @leybourne 3 роки тому +16

    Amazing presentation as usual. Thank you, Patrick!
    Python and R integration is good. However, there are too many limitations for using Python and R scripts in Power BI which Patrick did not mention (vide documentation).
    When we want to get data from a data source that is directly not supported in Power BI (quite rare nowadays!), an R/Python script may help. I remember Adam had a video on creating data connectors with C# as well (long time ago).
    We can do certain transformations that are beyond the capacity of M using R/Python scripting.
    What we need is a scripting language for Power BI that is comparable to VBA in Excel, a language that is truly incorporated, not superficially attached. R and Python script support in Power BI is still just sensational than truly useful. Let’s see how it develops in the due course.
    Definitely Interesting, but I doubt if it would be equally useful. Of course, it’s only my opinion as a user of Power BI. There are experts on the subject who think otherwise.

    • @matthiask4602
      @matthiask4602 3 роки тому +7

      don´t wish more scripting languages, python has to do the job. It should become the new VBA. (please!! I do not want to learn another language!!!)

    • @leybourne
      @leybourne 3 роки тому +7

      @@matthiask4602 Neither do I! LOL! C# and R are good enough for MSBI!
      What I meant was that the scripting language - be it Python, R or whatever -should be well incorporated into and supported by Power BI. Right now, there are ridiculous limitations.

    • @MattWhiteMattWPBS
      @MattWhiteMattWPBS 2 роки тому +1

      You're going to be the person blamed when Microsoft shoehorns VBA into PowerBI...!

    • @navjotsingh2251
      @navjotsingh2251 Рік тому

      @@leybourne I think python would be better, it would be difficult to use R as we use vba imo. Python fits nicely as a scripting language that will feel like vba for power bi.

    • @JHatLpool
      @JHatLpool Рік тому

      Can you not perform your transformations using DAX (which is similar to VBA) ?

  • @CaribouDataScience
    @CaribouDataScience 4 місяці тому

    Thanks

  • @swagatkumarsrivastava2322
    @swagatkumarsrivastava2322 3 роки тому +4

    Really looking forward to receive some more important lessons on Python in Power BI.

  • @alejandroespindola8023
    @alejandroespindola8023 3 роки тому

    Amazing

  • @aymanalafifi
    @aymanalafifi 3 роки тому +1

    Can you include a parameter inside your python script? I'm thinking if you have some code to read a file and clean your data for powerbi, it would be nice to define the file path as a parameter so the user can recycle and reuse your dashboard and code for other files

  • @user-mh3qm1cb6s
    @user-mh3qm1cb6s Рік тому

    Nice video: by any chance you know how to upload my dashboard with python visuals into a website? When I upload the dashboard, everything can be seen except these python visuals.

  • @soumaisti4085
    @soumaisti4085 2 роки тому

    Hi man, I got the examples but I'm a little confused because the Python language in Power Bi is just to plot some libraries or graphs? What are the real advantages related to Power BI? For example, I can download more visuals instead of implement using the R language? Tks

  • @marcoantoniobajanabarahona3300
    @marcoantoniobajanabarahona3300 2 роки тому

    You could make a video of how to use powerquery and phyton for some data transformation

  • @CloudandZack1st
    @CloudandZack1st 2 роки тому +2

    Just a friendly heads up: If you add python to your environment variables at the end of the installation (or the beginning depending on which version of Python you install), you can invoke pip without pointing to the directory. 😃

    • @CloudandZack1st
      @CloudandZack1st Рік тому

      @@jamesbyrnes8286 Yes, you can manually add the path to your environment variables either through cmd or through searching environment variables in the start menu.

  • @aryansena7290
    @aryansena7290 3 роки тому

    Need more videos in python with power Bi

  • @shubhrabhowmik
    @shubhrabhowmik 2 місяці тому +1

    how can I fetch data from sharepoint or web api and connect it here in power bi using python?

  • @Alex-dd3oy
    @Alex-dd3oy Рік тому

    good stuff

  • @stouttravis
    @stouttravis 3 роки тому +3

    I know an intermediate level of python, but have never looked into what's supported in Power BI. Seeing Patrick get something built so easily without evening knowing python was exciting as it shows the integration must be pretty well designed. I'm excited to go through and learn the limitations for myself.

    • @ducminh7568
      @ducminh7568 3 роки тому

      nah too bad it not that good with powerbi

    • @thefamousdjx
      @thefamousdjx 2 роки тому

      @@ducminh7568 why isnt it good? I found that with complex nested json, powerbi creates all these nested record and list objects and I have to go in and flatten them myself, unless I'm missing something as I just started using it. But with the python script the output comes out already flattened out

    • @ducminh7568
      @ducminh7568 2 роки тому

      @@thefamousdjx so it not that great because you cannot load Python code online via SharePoint but it has to be from your computer so that you cannot automate tasks with PowerBi services but desktop only.

  • @rauljimenez5485
    @rauljimenez5485 11 місяців тому

    Is it possible to refresh a Python source in the Service?

  • @xinchunhe3960
    @xinchunhe3960 2 роки тому +1

    What do you mean personal gateway? if i share my dashboard with other who doesn't have python install, will they see a error on their side?

  • @santoshadhikari9933
    @santoshadhikari9933 Рік тому

    How can we loop through Report object eg: slicer to export the report as PDF file using python script?

  • @vennelaneethipudi4573
    @vennelaneethipudi4573 Рік тому

    I have a requirement where I have to get values from 17 different worksheets of a excel file, so I wrote a python script that goes to each sheet and gets this single value and creates a dataframe. Now I am using this script in Power BI to get the dataframe into my model. But when I am trying to schedule a refresh it says the datasource is not supported. Is there any workaround or solution to this? Please help me out.

  • @kvelez
    @kvelez Місяць тому

    Thanks.

  • @lpribson
    @lpribson 3 роки тому

    any idea if you could open a pbi dataset in python?

  • @MeghaviThakar
    @MeghaviThakar 3 місяці тому

    Hey, great video but what if I want to take input from the user and use that in the Python code and give an output how can one do that?

  • @AlejandraRamirez-vj3vf
    @AlejandraRamirez-vj3vf 5 місяців тому

    how to read an excel file stored in a sharepoint with python in power bi? Without explicitly giving password and user or from an organizational account?

  • @richasugandhi2954
    @richasugandhi2954 4 місяці тому

    Hello, I got an error when loading the 'tips' dataset. So, In which folder should the tips file be

  • @SebasAvello
    @SebasAvello 2 роки тому +1

    I need help, when I try to show it with pit.show() appears this: ;NameError: name 'pit' is not defined

  • @andresmachad
    @andresmachad 3 роки тому +1

    heyy guy, how can i put it on powerbi services? because it don't work there

  • @sofyan471
    @sofyan471 3 роки тому +13

    Interaction is a problem with python. Some other visualisation tool has much better integration.
    Python is great but for visual we can't do interaction from python visual to other part of report

    • @Abhishekjain07
      @Abhishekjain07 3 роки тому +4

      Absolutely it's a great challenge. As a python lover I am dying to use python visuals in Power BI and just because of this interactive limitation I am not able to. SAD. Very 😥

    • @DanielWeikert
      @DanielWeikert 3 роки тому

      It works from a default viz to the python viz but not the other way round. But that is not the only issue. Currently there are too many limitations.
      By the way: what other viz tool? Have not seen any good integration so far

    • @VladMZ
      @VladMZ 3 роки тому

      @@DanielWeikert If you know Javascript, you can build your own custom Visuals. Although the process is tedious and lengthy if you want a really good working visual. Use Charticulator to build your own visuals with little to no coding.

    • @VladMZ
      @VladMZ 3 роки тому

      @@Abhishekjain07 I tried R too, and it has the very same issues. Sadly.

    • @LuisRomaUSA
      @LuisRomaUSA 3 роки тому

      You could if power bi supported the right libraries, but power bi only lets you use libraries that do not provide interaction

  • @paulinedahne
    @paulinedahne Рік тому

    I am trying to uncompressed a column in a dataset using pandas and lzstring. I have used this syntax but the Python script errors with TypeError: 'function' object is not subscriptable
    # 'dataset' holds the input data for this script
    import pandas as pd
    import lzstring as lz
    df = pd.DataFrame(dataset)
    df['DecompreseedAssets'] = lz._decompress['MigratedAssets']
    MigratedAssets column has data that is compressed using lzstring
    Could you help please?

  • @shubhammittal6509
    @shubhammittal6509 Рік тому

    Hi Patrick, I believe we can even transform data in Query Editor, through python scripting. Am I right?

  • @alencaru
    @alencaru 3 роки тому +6

    I use a lot R and Python in Power BI but the problem is not being able to take an input from the user and apply it to a model and then give back an output as (chart, table, list etc.) if it would possible to send information to Python and R it would be a big big game change especially to use NLP capabilities from both of languages.

    • @ak_shavar
      @ak_shavar 6 місяців тому

      Hi, I’m wondering if this is still the case as at Jan 2024. I’m looking to do something similar of taking user input and apply it to a model.

  • @ahv5457
    @ahv5457 4 місяці тому

    When I publish it online, I cannot set up the schedule refresh. Any solution?