Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hey all,
Here's some background: I'm very familiar with python pandas. Not so familiar with Power BI measures. It's been ok, but DAX coding just doesn't come so easily to me.
I have a simple question:
Has anyone seen or used python scripts used in a data model instead of having to create a bunch of measures?
Best.
Solved! Go to Solution.
Hey @Anonymous ,
I would not consider it a shame, as DAX is a "query language", whereas python is a "general purpose" programming language of course with great data processing support eg. pandas, ... not to mention all the things possible if we are considering more advanced algorithms.
But DAX is designed to wade through billions, trillions of rows in real time, meaning a user changes the slicer selection.
Personally I'm / we are (at enterprise level) using python to create more "composed" visuals, where the composition is more important than the interactivity provided by the default visuals that are based on d3.js.
From an enterprise perspective we are not using python from within Power BI for data transformation directly, but of course python can be used together with Azure Databricks, providing tremendous possibilities 🙂
Regards,
Tom
Hi,
Just in case people are reading this thread and looking for potential solution, here's an article I found to create multiple measures in Power BI using Python:
https://python.plainenglish.io/creating-multiple-measures-in-power-bi-using-python-7a8cf6e200dc
Hey,
basically you can't compare measures with using python, this is due to the fact that python can "just" be used
In the 1st case the python script will just be executed on data refresh and not during user interactions like filtering data using slicers. Of course the viusal will adapt to other slicer slections.
A measure can be "reused" in various visuals, whereas a python script has to be used multiple times, meaning multiple scripts have to be maintained.
My recommendation, start using DAX and "just"use python, if DAX or M can't solve the problem.
Regards,
Tom
When using python to create a visual the data is dynamically calculated based upon your slicers. Is there a way to get the data from a python visual and show it in a table, so that table dynamically changes with the visual?
Hey,
currently it's not possible to pass data from a python or r script visual back to Power Bi so that the data from the visula can be used inside a table or matrix viusal.
But maybe this article will provide you with some ideas:
https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.table.html
Regards,
Tom
Much appreciated man. Great insight that you could tell I was doing this within my company. That's a shame about Python, and I'll need to commit to measure in DAX. In what instances would people use Python scripts within Power BI? For 1-off reports mostly?
Also, Hamburg is a great city, I lived there for 3 months in 2013.
Best.
Hey @Anonymous ,
I would not consider it a shame, as DAX is a "query language", whereas python is a "general purpose" programming language of course with great data processing support eg. pandas, ... not to mention all the things possible if we are considering more advanced algorithms.
But DAX is designed to wade through billions, trillions of rows in real time, meaning a user changes the slicer selection.
Personally I'm / we are (at enterprise level) using python to create more "composed" visuals, where the composition is more important than the interactivity provided by the default visuals that are based on d3.js.
From an enterprise perspective we are not using python from within Power BI for data transformation directly, but of course python can be used together with Azure Databricks, providing tremendous possibilities 🙂
Regards,
Tom
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
84 | |
67 | |
60 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |