Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I want to implement something like this:
In a Notebook, there is a dataframe DF with its column name 'Success'. If the sum(DF$success)>0, then I want to trigger the next flow.
Can someone show how to implement this?
Solved! Go to Solution.
Hi @tan_thiamhuat ,
Yep, you can do this in your notebook by checking the sum of the 'Success' column and then using mssparkutils.notebook.exit to pass a value back to the pipeline. Here’s an example in PySpark:
success_sum = DF.selectExpr("sum(Success)").collect()[0][0] if success_sum > 0: mssparkutils.notebook.exit("trigger_next") else: mssparkutils.notebook.exit("do_not_trigger")
In your pipeline flow, you can use the output value from the notebook activity to decide whether to trigger the next activity/flow or not. Just set up a conditional check in the pipeline based on the notebook’s output string.
Let me know if you need more details or some other way to handle it.
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
Hi @tan_thiamhuat ,
Yep, you can do this in your notebook by checking the sum of the 'Success' column and then using mssparkutils.notebook.exit to pass a value back to the pipeline. Here’s an example in PySpark:
success_sum = DF.selectExpr("sum(Success)").collect()[0][0] if success_sum > 0: mssparkutils.notebook.exit("trigger_next") else: mssparkutils.notebook.exit("do_not_trigger")
In your pipeline flow, you can use the output value from the notebook activity to decide whether to trigger the next activity/flow or not. Just set up a conditional check in the pipeline based on the notebook’s output string.
Let me know if you need more details or some other way to handle it.
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
I have this two conditions:
## when there is CSV file to be processed
It always go to the False loop, even if there is CSV file available to be processed. Is my logic correct?
User | Count |
---|---|
25 | |
17 | |
5 | |
5 | |
2 |
User | Count |
---|---|
49 | |
43 | |
18 | |
7 | |
6 |