LowCodeStacks™
Sign in

Power BI write back, finally native: translytical task flows explained

Buttons in a Power BI report that update the database — translytical task flows pair Fabric user data functions with data function buttons and input slicers, so readers can write back without leaving the report.

Power BIFix a problem4 min read

Checked against Microsoft Learn 4 sources · Updated By · drafted with AI help, checked by a personHow we write guides

For years, "can users update the data from the report?" ended every Power BI conversation with no, export to Excel. Translytical task flows change the answer: a button in the report calls a Fabric user data function, which writes to the source — annotations, status updates, approvals, discount changes, all without leaving the page.

The reader selects a table row and types a value into the input slicer. The data function button enables, because it stays disabled until every parameter has input. The reader clicks, and the button's Loading state shows text such as Submitting while the function runs. The Fabric user data function, written in Python, validates every parameter and writes with parameterised SQL to a Fabric SQL database, warehouse or lakehouse files; Microsoft recommends a SQL database for most write-back. The semantic model then shows the change: live with DirectQuery, or after the next refresh with Import. If the input is valid, the function returns a string and the report shows it as the message. For an expected problem it raises fn.UserThrownError, and the report shows that message instead of a stack trace. Test after publishing: in Power BI Desktop you can configure everything, but the button won't trigger until the report is published to the service.
A data function button runs a user data function that writes to Fabric, and the report shows the string it returns.

The moving parts

Three pieces make a flow:

  • A user data function in Fabric — your code (Python), with native connection management for Fabric SQL databases, warehouses and lakehouse files. Microsoft recommends a SQL database for most write-back, since it handles mixed read/write load well. The function must return a string — that string becomes the message the report shows.
  • A data function button on the report page, its action type set to Data function, picking your function from the OneLake catalog.
  • Input controls — slicers, selected rows or measures — bound to the function's parameters.

The semantic model can be DirectQuery (updates appear live), Direct Lake, or even Import — with Import the change lands in the source but waits for the next refresh to show.

Wire the button

  1. Add a button, open Action, set Type to Data function, and choose the function via the fx picker.
  2. Each function parameter appears below: bind one to a slicer on the page, another to a data field or measure (with a summarisation such as Maximum when rows aggregate).
  3. The button stays disabled until every parameter has input — clicking a table row or filling a slicer enables it, which doubles as your wiring test.
  4. Style the Loading state: data function buttons get an extra button state with a spinner, for text like "Submitting…" while the function runs.
  5. Optionally turn on Auto clear so input slicers empty themselves after a successful call.

Note

In Power BI Desktop you can configure everything but the button won't trigger until the report is published to the service — plan the first real test there.

Collect input with the input slicer

The input slicer (the renamed text slicer, now generally available) has two personalities: with a data column it filters; without one it's a pure input control — a text box whose value exists to be passed into your function. That's the pattern for comments, new values and annotations. A button slicer beside it covers pick-one choices such as a status.

One click, one write
  1. Step 1Reader selects a row and types a value
  2. Step 2The button enables
  3. Step 4The report shows the function's message

Harden the function before anyone clicks

Microsoft's own best-practice list is the difference between a demo and something you'd let a department use:

Do

  • Validate every parameter, and raise fn.UserThrownError("…") for expected problems — the report shows your message instead of a stack trace.
  • Wrap database calls in try/except and return a friendly failure message for an unreachable source.
  • Write parameterised SQL — a write-back button is an injection surface if you concatenate input.
  • Return a clear success message; the reader sees exactly that string.

Beyond plain write-back, the same machinery powers status workflows with history and Teams notifications, and in-report alerts where notifications are just rows your function writes and the report displays. Microsoft ships tutorials for both.

Sources

Add LowCodeStacks as a preferred source on Google

Did this fix it?

Get the weekly email

New guides and updates from LowCodeStacks, every Tuesday. One email a week, no more.

From LowCodeStacks, Regina, SK, contact@lowcodestacks.com. You can unsubscribe any time, from the link in every email or in your privacy settings. See the Privacy notice.

Comments

No comments yet. Share what worked for you.

Sign in to comment. Comments show under a display name you choose, never your email.