Is there a way to use PyScript in PowerBI to write a summary?

25 views Asked by At

Unable to use PyScript as an alternative of Smart Narrative where Dynamic Summary can be added.

I tried using Smart Narrative in order to create a dynamic summary. One of the examples is as follows: (Genre with Highest Delivered Clicks) is the Genre which delivered (Highest Delivered Clicks) in the year 2023 However, in most cases I faced an issue where a single value was not fetched.

As an alternative, I turned to PyScript. I used the following code:

import pandas as pd
df = dataset
max_genre = df.loc[df['Delivered Clicks'].idxmax(), 'Genre']
sentence = f"The genre that consistently delivers the highest number of clicks is {max_genre}."
print(sentence)

However, PowerBI prompts that an image could not be generated.

Is this a limitation of this feature? Can I not use PyScript like I use Smart Narrative or is there a problem in my code?

0

There are 0 answers