Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hello,
I want to create a custom waterfall chart. Found a beautiful piece of code on github for exactly this purpose.
Everytime I see python script used in a visualization the variables are always defined as columns. My waterfall chart should be build based on measures instead of columns.
I already put them in the "Values" pane but I'm having trouble how to incorporate those into the python code. I need something like this:
"target = [Month Target]" where the name between the brackets is measures name of course.
Any ideas?
Solved! Go to Solution.
Hi @MKMA,
Thank you for reaching out to the Microsoft Fabric Forum Community.
Python visuals in Power BI treat incoming data from the Fields/Values pane as a Pandas DataFrame, but measures behave differently than columns when passed into a Python visual. Measures Do not become standalone variables, they're aggregated and usually show up as part of a DataFrame row.
Use SUMMARIZE to simulate rows
create a table with measures as columns in Power BI using DAX like this:
WaterfallTable =
SUMMARIZE(
'YourBaseTable',
'YourBaseTable'[Category],
"Target", [Month Target],
"Actual", [Month Actual],
)
Then you can add this calculated table to the Python visual like a regular dataset, and reference like:
target = dataset['Target']
actual = dataset['Actual']
If you find this response helpful, please consider marking it as the accepted solution and giving it a thumbs-up to support others in the community.
Thank you & regards,
Prasanna Kumar
Hi @MKMA,
Just a gentle reminder — has your issue been resolved? If so, we’d be grateful if you could mark the solution that worked as Accepted Solution, or feel free to share your own if you found a different fix.
This not only closes the loop on your query but also helps others in the community solve similar issues faster.
Thank you for your time and feedback!
Best,
Prasanna Kumar
Hi @MKMA,
We wanted to kindly check in to see if everything is working as expected after trying the suggested solution. If there’s anything else we can assist with, please don’t hesitate to ask.
If the issue is resolved, we’d appreciate it if you could mark the helpful reply as Accepted Solution — it helps others who might face a similar issue.
Warm regards,
Prasanna Kumar
Hi @MKMA,
Just following up to see if the solution provided was helpful in resolving your issue. Please feel free to let us know if you need any further assistance.
If the response addressed your query, kindly mark it as Accepted Solution and click Yes if you found it helpful — this will benefit others in the community as well.
Best regards,
Prasanna Kumar
Hi @MKMA,
Thank you for reaching out to the Microsoft Fabric Forum Community.
Python visuals in Power BI treat incoming data from the Fields/Values pane as a Pandas DataFrame, but measures behave differently than columns when passed into a Python visual. Measures Do not become standalone variables, they're aggregated and usually show up as part of a DataFrame row.
Use SUMMARIZE to simulate rows
create a table with measures as columns in Power BI using DAX like this:
WaterfallTable =
SUMMARIZE(
'YourBaseTable',
'YourBaseTable'[Category],
"Target", [Month Target],
"Actual", [Month Actual],
)
Then you can add this calculated table to the Python visual like a regular dataset, and reference like:
target = dataset['Target']
actual = dataset['Actual']
If you find this response helpful, please consider marking it as the accepted solution and giving it a thumbs-up to support others in the community.
Thank you & regards,
Prasanna Kumar
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 38 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 68 | |
| 67 | |
| 30 | |
| 26 | |
| 26 |