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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors