Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Sleopol1995
Regular Visitor

PowerBI Parameters, and Python

Hello everyone, 

 

I'm currently trying to make a python statement that controls an imported message box based on the user's selected parameter. 

 

Currently, I am using the following code to try and accomplish this: 

 

import win32api
if '"&Text.From(Valid?)&"' == 'Yes all data has been validated':
win32api.MessageBox(0, 'All Data is Validated!', 'Data Validation Complete')
else:
'"&Text.From(Valid?)&"'== 'Not all data has been validated'
win32api.MessageBox(0, 'All Data is not Validated!', 'Data Validation Complete')

 

However, when I make a selection on the parameter it does not seem to control the message box. 

 

Is it a possibility to control an imported message box function based on a user's parameter selection? 

 

Below is a table on which I have based the parameter on. The parameter is a text parameter using the below two values. 

 

Sleopol1995_0-1625575073826.png

 

 

Thank you! 

1 REPLY 1
Anonymous
Not applicable

Hi @Sleopol1995 

Where did you run python, desktop or query editor ? When you make a selection on the parameter ,what’s the result returned ? What is the result you expect ?

If possible, could you provide a complete sample (hiding sensitive information) ?

 

Best Regards

Community Support Team _ Ailsa Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.