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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Python pop up message showing up multiple times

Hi!

 I made a script that checks if a table is empty or not, and if it's empty, a pop up message shows up. The problem is that the message shows up like 5 or 6 times, instead of just one. I couldn't find the solution or even the cause of this problem. 

(What I really wanted to do in the first place is to evaluate if theres content in that table, and if it's empty, ommit it's visualization, or hide it's page, but couldn't find how, so for now I'm using the pop up, but I would take one of these as a solution as well).

 

Here is an example of my code:

 

if len(dataset['Accounts']) == 0:
      win32api.MessageBox(0, 'Accounts not found. Visualizations will not load correctly', 'Warning')

 

 I don't understand why it's getting executed some many times.

 

 

Thank you in advance!

2 REPLIES 2
lbendlin
Super User
Super User

I got some bad news for you I am afraid.  There is no guarantee whatsover that Power Query will run your code only once.

 

Chris Webb's BI Blog: Why Is Power BI Running My SQL Query Twice? Chris Webb's BI Blog (crossjoin.co...

Anonymous
Not applicable

Oh, I see. I read the article. It seems that isn't just an issue with python. I'll try to find another way then.

Thank you!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors