Questions and short answers
Data engineers
How do I build an app on a Power BI semantic model with Fabric Apps?
Create the project with the Rayfin CLI 2.0.1 using the dataapp template, then add the semantic model as a fabric-semanticmodel connector with rayfin connector add. Build the screens yourself or with a coding agent, and deploy with rayfin up. Users sign in with Fabric. The steps section lists each command; none was run against a tenant. Fabric Apps: from a semantic model to a working app
Are Fabric Apps generally available?
Yes, per Microsoft's announcement of 17 November 2026. Some parts are still preview: Microsoft lists anonymous data access as preview, and the Power BI Desktop for Apps documentation says preview. The What's new page on Microsoft Learn still showed the apps as preview when checked on 2026-11-29, so it lags the announcement. Fabric Apps: from a semantic model to a working app
Why does my Fabric App open but its queries fail?
Sharing the app does not share the semantic model behind it. Per Microsoft's sharing page for Fabric Apps, give recipients access to the related semantic model too, because the semantic model connector runs each query with the signed-in user's own permissions. Until they have that access, the app opens and every query fails. Fabric Apps: from a semantic model to a working app
What do I need before creating a Fabric App?
Per Microsoft's template page: current Node.js, a workspace role of Contributor, Member or Admin, Build and Read permission on the semantic model, and the tenant setting Semantic Model Execute Queries REST API enabled. A tenant admin enables the Fabric Apps tenant setting. Fabric Free alone cannot create apps; you need a Power BI Pro licence, with limits, or a Fabric capacity or trial. Fabric Apps: from a semantic model to a working app
Do I need a coding agent to build the screens?
No. The dataapp template is designed to work with a coding agent, and the Rayfin CLI 2.0.1 can install agent instruction files in the project with rayfin init ai-files install (listed in the CLI help), but you can write the screens yourself. If you use an agent, tell it to inspect the model first and never to guess table or column names. Fabric Apps: from a semantic model to a working app
Is a Fabric App with a semantic model connector secure by default?
Partly. The semantic model connector supports delegated authentication only, so each user's own permissions apply. TypeScript types on the client are not a security boundary: limit what the app may do with the connector's operations option, and use roles and row policies on the data side. Never put secrets in frontend assets. Fabric Apps: from a semantic model to a working app
When should I build a Fabric App instead of a Power BI report?
Build an app when people need their own screens, buttons and a product-like experience with Fabric sign-in, more than a report gives. Microsoft says apps might not suit complex multi-step transactions, stored procedures or sign-in providers other than Fabric SSO. For standard analysis a report is enough. The article's problem section frames the choice. Fabric Apps: from a semantic model to a working app
Which Rayfin CLI version does this article cover?
It follows @microsoft/rayfin-cli 2.0.1, the npm latest tag, built on 17 November 2026. A preview tag, 2.1.0, and an experimental tag also exist, and their flags may differ. Only the help output of 2.0.1 was read and checked by a small script; no command was run against a Fabric tenant. Fabric Apps: from a semantic model to a working app
What should I put in CLAUDE.md for a data engineering project?
Put facts the agent cannot guess: your layers, naming rules, environments and test command, for example bronze, silver, gold, snake_case names and pytest -q. Anthropic's Claude Code documentation recommends under 200 lines per file, because longer files are followed less well. Concrete lines such as "no SELECT *" work better than "write clean SQL". Set up Claude Code for a data project, with guardrails
Is CLAUDE.md enough to keep Claude Code away from production?
No. Anthropic's documentation says Claude Code treats CLAUDE.md files as context, not enforced configuration. To block an action whatever the agent decides, use a PreToolUse hook or a permission rule. The article's four layers are CLAUDE.md as context, then a read-only subagent, deny rules and a hook, which enforce. Set up Claude Code for a data project, with guardrails
How do I make a Claude Code subagent that can only read?
List its tools in the subagent's front matter, for example tools: Read, Grep, Glob, and leave Bash out. Only name and description are required, and tools works as an allowlist. Anthropic's documentation notes that a subagent with Bash can still change files through the shell, so a short list is what keeps it read-only. Set up Claude Code for a data project, with guardrails
How do I stop Claude Code from reading my .env file?
Add Read deny rules in .claude/settings.json, for example Read(./.env), Read(./.env.*) and Read(./secrets/**). Claude Code checks deny rules before ask and allow rules, and the first match wins. Then run /permissions to see which rules loaded, and ask the agent to read .env: it must be refused. Set up Claude Code for a data project, with guardrails
Does a .claudeignore file hide secrets from Claude Code?
No. The permissions page of the Claude Code documentation says a .claudeignore file has no effect. Move its entries into Read deny rules in .claude/settings.json, such as Read(./.env). A path pattern starting with a single slash is not an absolute path, so use a double slash for the filesystem root. Set up Claude Code for a data project, with guardrails
How can a Claude Code hook block a destructive SQL command?
Register a PreToolUse hook on Bash. It receives the call as JSON on stdin, with the command in tool_input.command, and exit code 2 blocks the call and sends stderr to Claude. Exit code 0 only means no objection. The sample script needs jq and matches text, so SQL stored in a file and run by a script passes. Set up Claude Code for a data project, with guardrails
Can deny rules and hooks fully protect my secrets in Claude Code?
Not completely. Read deny rules apply to the built-in file tools and to Bash file commands Claude Code recognizes, such as cat, head, tail, sed and tee. For Grep and Glob the documentation says Claude makes a best-effort attempt. A Bash command you approve can still write anywhere your user can, so consider sandboxing. Set up Claude Code for a data project, with guardrails
Was this Claude Code setup tested in a Claude Code session?
No. The files were syntax-checked on macOS with jq 1.7.1 and Python 3.14.8, and the hook script exited 0 for two harmless commands and 2 for four it should block. Claude Code 2.1.296 was installed, but no session loaded these files. The documentation pages do not give a version number for these features, so none is claimed. Set up Claude Code for a data project, with guardrails
How do I find out why a Fabric pipeline failed?
Open the Monitoring hub, filter by failed status and open the run. The run detail view shows the pipeline diagram, run ID, status, errors and the list of activity runs. Open the failed activity and read its error code, message and failure type. The pipeline-level error is a summary; the activity's own error is what to act on. See the Steps section. A Fabric pipeline failed overnight: find the cause, rerun safely
Can I rerun only the failed activity in a Fabric pipeline?
Yes. In the Monitoring hub, open the run's detail view and select Rerun. The legacy hub lets you rerun the entire pipeline, start from the failed activity, or start from a selected activity. The new hub (preview) offers the entire pipeline, only failed activities, or selected activities. Rerun only after the cause is fixed and the activity is safe to repeat. A Fabric pipeline failed overnight: find the cause, rerun safely
Should I set retries on a Fabric pipeline activity?
Only for errors that go away on their own, such as throttling or a brief outage. In an activity's General tab, Retry takes 1 to 1000 attempts and defaults to 1. By default an activity retries on any failure, so a wrong password is retried too. Retry conditions can limit retries to chosen error codes, but they are in preview. A Fabric pipeline failed overnight: find the cause, rerun safely
How does exponential back-off work for Fabric pipeline retries?
Set Retry interval type to Increasing Delay. Before each retry the engine picks a random wait inside a range that doubles each time, capped at Max retry interval. With the defaults of 30 and 3600 seconds, retry 1 waits 0 to 30 seconds, the range doubles each time, and the upper end never exceeds 3600 seconds. Learn lists this as generally available since September 2026. A Fabric pipeline failed overnight: find the cause, rerun safely
How do I get an email when a scheduled Fabric pipeline fails?
Open the item's schedule and add users or groups under Failure notifications. You need at least the Contributor role or Write permission on the item. Emails go only to Microsoft Entra users and groups, and only for scheduled runs, never manual ones. The email has the item, submitter, error details, UTC time and a link to the monitoring hub. A Fabric pipeline failed overnight: find the cause, rerun safely
Can I list failed Fabric pipeline runs with the REST API?
Yes. GET /v1/workspaces/{workspaceId}/items/{itemId}/jobs/instances returns job instances with status, startTimeUtc, endTimeUtc and, for a failed one, failureReason. Most items keep only the 100 most recent completed entries. For activity-level errors, the documented POST to queryactivityruns returns each activity's error. Both calls are in the Steps section; neither was run here. A Fabric pipeline failed overnight: find the cause, rerun safely
Why did my Fabric pipeline schedule stop running?
After repeated consecutive failures, typically 10 though it varies by item, the platform puts the schedule in an auto-disabled state. Restart it in the UI, through the API or through CI/CD. A schedule also expires if its owner does not sign in to Fabric for 90 consecutive days, and taking over an item does not move schedule ownership. A Fabric pipeline failed overnight: find the cause, rerun safely
How do I do an incremental load without duplicate rows?
Keep a watermark, the newest modified time already loaded. Read only newer rows, keep one row per key in the batch, and write them with MERGE on the business key instead of INSERT, in DuckDB 2.0.1 or Fabric Warehouse T-SQL. Move the watermark in the same transaction as the merge, so a retry changes nothing and a failed run leaves no half-load. Incremental load that does not duplicate rows
What is an idempotent load?
A load you can run twice and get the same table. With a watermark and MERGE on the business key, a repeated run finds no newer rows, or finds the same rows and overwrites them with identical values. In the recorded DuckDB 2.0.1 run, the second run extracted 0 rows and the target stayed at 4 rows. Incremental load that does not duplicate rows
Why does my pipeline duplicate rows after a retry?
Because a plain INSERT has no memory. If a run fails after the INSERT and the scheduler retries, the same rows land twice. In the recorded DuckDB 2.0.1 demo, each load crashed once after the INSERT and was retried, ending with 12 rows for 4 distinct ids. A MERGE on the business key matches existing rows instead. Incremental load that does not duplicate rows
Should the watermark filter use > or >=?
With plain INSERT, > avoids repeated rows but can lose late rows that share the watermark's timestamp. With MERGE, >= is safe because repeated rows are matched and not duplicated. Microsoft's Fabric example uses >= for that reason, and its mirrored-database example suggests an overlapping window for continuously replicated data. Incremental load that does not duplicate rows
Why must the watermark move in the same transaction as the MERGE?
Because the target and the watermark must succeed or fail together. If the watermark moves first and the merge then fails, those rows are lost for good. In Fabric Warehouse T-SQL, SET XACT_ABORT ON with BEGIN TRAN and COMMIT rolls everything back on any error. In the recorded DuckDB run, a failure before commit left both unchanged. Incremental load that does not duplicate rows
Does a watermark load catch deleted rows?
No. A row deleted in the source never appears in a query for newer rows. Use soft deletes, change data capture or a periodic full comparison. Only use WHEN NOT MATCHED BY SOURCE THEN DELETE against a complete authoritative source, never against a partial batch, because it would delete every row the batch did not contain. Incremental load that does not duplicate rows
What happens if two rows with the same key reach MERGE?
Microsoft's documentation says MERGE expects at most one source row per target key for Fabric Warehouse, so deduplicate the batch first. The project does it with row_number, keeping the latest version per id. What each engine does with duplicate keys was not tested here. Break ties on the change column with a second column so the winner is repeatable. Incremental load that does not duplicate rows
Can two loads of the same Fabric Warehouse table run at once?
Avoid it. Fabric Warehouse locks at table level, and two transactions that MERGE the same table can conflict. Microsoft's transactions documentation reports errors 24556 and 24706 and advises retry logic with a delay. MERGE is generally available in Fabric Data Warehouse per the T-SQL surface area page; the T-SQL in the article was not executed. Incremental load that does not duplicate rows
How do I deploy Microsoft Fabric items from GitHub?
Connect the dev workspace to a GitHub branch with Fabric Git integration, merge changes by pull request, then run a GitHub Actions workflow that calls fabric-cicd 1.4.0. It publishes the item folders in the repository to the target workspace, replacing environment-specific IDs from parameter.yml. The workflow section shows the file; it was not executed against a tenant. Deploy Fabric items from GitHub to test and prod
What is fabric-cicd?
fabric-cicd is an open-source Python library, latest release 1.4.0 on 2026-10-07, that publishes Fabric item definitions from a source-controlled folder to a workspace through the Fabric REST APIs. Microsoft Learn states the Fabric product team officially supports and recommends it. Each run is a full deployment of the item types you put in scope, not a diff. Deploy Fabric items from GitHub to test and prod
Should I use fabric-cicd or the Fabric CLI fab deploy command?
Either works, because fab deploy runs fabric-cicd underneath. Choose fab deploy if you prefer a YAML config and no Python. Choose the library if you want logic around the deployment, such as the checks in the project below. Note the difference in the Microsoft tutorial: fab deploy also unpublishes items that no longer exist in the source. Deploy Fabric items from GitHub to test and prod
What does unpublish_all_orphan_items delete?
It removes workspace items of the in-scope types that are not in the repository. In fabric-cicd 1.4.0 the documentation says Lakehouses, Warehouses and some other types are only deleted when their own enable_*_unpublish feature flag is set. Deleted items go to the recycle bin by default. Review what is in the target workspace before you call it, and never run it first against prod. Deploy Fabric items from GitHub to test and prod
Why do my notebooks point to the wrong lakehouse after deployment?
Because the notebook definition contains the dev workspace and lakehouse GUIDs, for example in the default lakehouse metadata. Microsoft's tutorial calls these hardcoded GUIDs. Replace them at deploy time with find_replace entries in parameter.yml and the variables $workspace.$id and $items.Lakehouse.<name>.$id, and pass an environment name that exists in that file. Deploy Fabric items from GitHub to test and prod
How should GitHub Actions authenticate to Fabric?
Sign in with azure/login v3 using OpenID Connect and a service principal, then let fabric-cicd use AzureCliCredential. The Azure Login documentation recommends OIDC and needs id-token: write. The service principal also needs the tenant setting that lets service principals use Fabric APIs, plus a role on each target workspace. Fabric's own connection to GitHub still uses a personal access token. Deploy Fabric items from GitHub to test and prod
Is Fabric Git integration with GitHub generally available?
Microsoft Learn lists GitHub as a supported provider and shows no preview label on the admin settings page, but the getting-started page still links to those switches by anchors ending in preview, and several item types are marked preview. No dated general-availability announcement for GitHub was found on 2026-11-29. Check the item type you use. Deploy Fabric items from GitHub to test and prod
What can fabric-cicd not deploy?
It supports only items that have source control and public create and update APIs. The fabric-cicd documentation lists 31 item types, among them Lakehouse, Notebook, DataPipeline, SemanticModel and Report. Other items are not supported. Shortcuts need the enable_shortcut_publish feature flag. Bulk publish mode is experimental, so this Pattern uses the default mode. Deploy Fabric items from GitHub to test and prod
Analysts
What is Performance Analyzer in Power BI?
Performance Analyzer is a pane in Power BI Desktop, and in the report editor in the Power BI service, that records how long each visual takes to load after each interaction. It splits the time into DAX query, Direct query, visual display and other, and can export the log as a .json file. Microsoft documents it as available with no preview label (checked 2026-11-29). Slow Power BI report: find the culprit before you fix it
How do I find which visual makes my Power BI report slow?
Open Performance Analyzer, select Start recording, then refresh the visuals or change a slicer, and read the Duration column. The visual with the longest total is the first suspect. Expand it to see whether the time sits in the DAX query, in drawing the visual, or in Other. Fix that part first and record again. Slow Power BI report: find the culprit before you fix it
How do I get the DAX query of a slow Power BI visual?
Expand the visual in Performance Analyzer and select Copy query, or Run in DAX query view in Power BI Desktop. The service has no Run option: copy the query, open the data model from the report and paste it into DAX query view there. Microsoft notes that web DAX query view needs a workspace setting still labelled preview. Slow Power BI report: find the culprit before you fix it
Why does Performance Analyzer show a long time for a visual that is not slow?
Most canvas and visual operations in Power BI run one after another on a single user interface thread, and the reported durations include time spent queued while other operations finish. A cheap visual can therefore show a long total when many visuals update together. Read the DAX query time first, then count what updates at once. Slow Power BI report: find the culprit before you fix it
Why is my report fast in Power BI Desktop and slow in the service?
Performance Analyzer in Desktop runs on your machine, which differs from the service in data volume, concurrent users, storage mode, gateway, capacity, query caching, query parallelization, connections and row-level security. Microsoft lists these differences on its report-level auditing page. Record in the web editor too, and check the capacity if it is Premium or Fabric. Slow Power BI report: find the culprit before you fix it
Can I use Performance Analyzer in the Power BI service?
Yes, when you edit a report: select Edit, then the View menu, then Performance Analyzer. Microsoft's September 2025 Power BI update lists it as available in the web editing experience. It cannot be used to monitor Premium Per User (PPU) activities or capacity, and the Run in DAX query view option is Desktop only. Slow Power BI report: find the culprit before you fix it
Performance Analyzer, Capacity Metrics app or SQL Server Profiler: which should I use?
Use Performance Analyzer first, because it shows which visual and which part is slow. Use the Fabric Capacity Metrics app when the report sits on a Premium or Fabric capacity and you suspect overload. Use SQL Server Profiler when the source is SQL Server or Analysis Services and you need to see the queries. Microsoft documents all three. Slow Power BI report: find the culprit before you fix it
What is a DAX user-defined function?
A DAX user-defined function (UDF) is a named piece of DAX logic with parameters that you define once in the model and call like a built-in function. You can use it in a measure, a calculated column, a visual calculation or another UDF. It is defined with the FUNCTION keyword and needs database compatibility level 1702 or higher. DAX user-defined functions: write the logic once
How do I create a user-defined function in Power BI?
Open DAX query view in Power BI Desktop, write DEFINE FUNCTION name = ( parameters ) => expression, test it with EVALUATE, then click Update model with changes to save it. In TMDL view the form is createOrReplace function, saved with Apply. The functions are stored in functions.tmdl in a Power BI project. The steps section shows both forms. DAX user-defined functions: write the logic once
Are DAX user-defined functions generally available or still in preview?
They are generally available in Power BI Desktop and the Power BI service since the June 2026 update, version 2.155.756.0, according to Microsoft Learn's monthly update page and its documentation. They were in preview in 2025 and early 2026. Some related features have a different status: the status section lists what was and was not checked. DAX user-defined functions: write the logic once
Can I use a DAX UDF in the Power BI service?
Yes, to a point. Microsoft's overview says DAX UDFs are generally available in the Power BI service and that you can view and edit them in the browser through web modeling. Authoring in Power BI Desktop (DAX query view, TMDL view, Model view) is the path the documentation describes in detail, so use it for larger changes. DAX user-defined functions: write the logic once
How do I list all user-defined functions in a model?
Run EVALUATE INFO.USERDEFINEDFUNCTIONS() in DAX query view for full metadata, which needs write permission on the model. For names and limited metadata only, run EVALUATE INFO.FUNCTIONS("ORIGIN", "2"). In Power BI Desktop the functions also appear under the Functions node in Model explorer. DAX user-defined functions: write the logic once
Why does my DAX UDF ignore the filter I remove inside it?
Because a table parameter is evaluated before the function runs by default (val). Declare it TABLE EXPR so the function receives an unevaluated expression and can change filter context inside, for example with CALCULATETABLE and ALL. In Microsoft's example the two versions return different row counts. DAX user-defined functions: write the logic once
What are the limits of DAX user-defined functions?
Per Microsoft Learn: no recursion or mutual recursion, no overloading, no explicit return type, no parameter descriptions, no display folders, no translations, and a UDF cannot be hidden. Object-level security does not carry over to functions. Parameters are limited to 256. A UDF cannot return an enum value. The limits section lists the rest. DAX user-defined functions: write the logic once
Should I use a UDF or copy the measure logic?
Use a UDF when the same logic sits in several measures or columns, because a fix is then made once, in one definition. Copying is fine for logic used one time. A UDF comes with limits: it cannot be recursive, hidden or put in a display folder. Microsoft Learn describes UDFs as a way to centralize business rules. DAX user-defined functions: write the logic once
What are translytical task flows in Power BI?
They are a way to take action from a report. A data function button sends the current selection and typed values to a Fabric user data function, which can add, edit or delete records, call an external API or store notifications as data. Microsoft describes them in the Power BI documentation as generally available since the March 2026 update. Translytical task flows in Power BI: what they are
Are translytical task flows generally available or in preview?
Generally available. Microsoft's Power BI update archive lists them as generally available in the March 2026 update (version 2.152.882.0), with optional parameters generally available in May 2026. One Microsoft page still differs: the Cosmos DB in Fabric guide says task flows are in public preview. This Pattern follows the Power BI pages and the archive. Translytical task flows in Power BI: what they are
Which data sources can a translytical task flow write to?
User data functions have native connection management for Fabric SQL databases, Fabric warehouses and Fabric lakehouses, where lakehouses mean files. Microsoft recommends SQL database for most write-back scenarios. A function can also call any API reachable over the network, so other systems can be updated through their own endpoints. Translytical task flows in Power BI: what they are
Do I need to write code to build a translytical task flow?
Yes, one function. The action lives in a Fabric user data function written in Python, which the report calls from a button. Everything else is configuration in Power BI Desktop: a slicer or table for the input, and a button of type Data function. Microsoft links to sample functions from its overview page. Translytical task flows in Power BI: what they are
What are the limits of translytical task flows?
The function must return a str to be added to a report. Power BI Embedded is supported only for secure embed scenarios. The button stores a fixed workspace and function, so after a deployment pipeline you must point it at the new function. A published function can run for at most 240 seconds and accepts a 4 MB request. Translytical task flows in Power BI: what they are
Does the report show my change straight away?
It depends on the storage mode. Microsoft's user data functions overview says updated values appear immediately for Direct Lake or DirectQuery reports, and after an automatic refresh triggered by the task flow for import-mode reports. By default the button refreshes the report after a successful run; that behaviour can be switched off. Translytical task flows in Power BI: what they are
Who can run a data function button?
Only people authorised to run the function. Anyone else sees a Something went wrong message. Give report users the Execute functions permission on the user data function, from its Share dialog. The tutorial also notes that in Power BI Desktop you cannot trigger the action until the report is published. Translytical task flows in Power BI: what they are
What is a Fabric user data function?
A reusable Python function that runs serverless inside Fabric and can be called from pipelines, notebooks, Activator rules, Power BI translytical task flows or any system through its own REST endpoint. Microsoft documents a Python 3.11.9 runtime, PyPI libraries and managed connections to Fabric data sources. The function code is the same whoever calls it. Write back to a Fabric SQL database: the user data function
How do I connect a user data function to a Fabric SQL database?
In the function item select Manage connections, then Add data connection, pick the SQL database and connect. Fabric creates an alias for the connection. In the code, decorate the function with @udf.connection(argName="sqlDB", alias="<alias>") and call sqlDB.connect() to get a pyodbc connection, which is what Microsoft's tutorial recommends for SQL. Write back to a Fabric SQL database: the user data function
Why does my user data function not show up in the Power BI button?
Because it does not return a string. Both the tutorial and the button page say that data function buttons require the function to return a str, and that missing functions are usually a return type problem. Change the return annotation to str, return a message, publish again and reopen the function picker in the button settings. Write back to a Fabric SQL database: the user data function
How do I show an error message to the report reader?
Raise fn.UserThrownError with the text you want shown, for example when a description is longer than 200 characters. The report then shows Something went wrong and the reader can select View details to read your message. Microsoft recommends validating each parameter this way and writing a friendly success message too. Write back to a Fabric SQL database: the user data function
How do I avoid SQL injection in a user data function?
In this example, each question mark marks where a value goes in the statement. Pass the values to cursor.execute separately, in the same order. Validate their length and range before writing to the database. This keeps user input out of the SQL text. Write back to a Fabric SQL database: the user data function
Who needs permission to run the function from a report?
Everyone who presses the button. On the function item select Share, open Additional permissions and pick Execute Functions and View Functions Logs, then add the users or groups. People without it get a Something went wrong response. You also need access to the SQL database yourself to test the function. Write back to a Fabric SQL database: the user data function
What are the limits of a user data function, and is SQL database in Fabric generally available?
A function can run for 240 seconds, take 4 MB of request parameters and return 30 MB. Logs are kept 30 days. The SQL database overview page carries no preview label, while its limitations page marks only the ALTER DATABASE SET options as preview, and a trial capacity allows three databases. Checked 2026-11-29. Write back to a Fabric SQL database: the user data function
How do I add a data function button in Power BI?
Add a button, open Format button, expand Action, turn it on and set Type to Data function. Select the fx button next to Data function, pick the function in the OneLake catalog, then map each parameter to a slicer, a data field or a measure. Microsoft documents this in Power BI Desktop and the Power BI service. Run a user data function from a Power BI button
Why can I not see my function in the data function picker?
Most likely because it does not return a string. Both Microsoft's tutorial and the button page tell you to check that the function returns a str when the function is missing. Fix the return type in the user data function, publish it again, and reopen the picker from the button's Action settings. Run a user data function from a Power BI button
Can I test the button in Power BI Desktop?
You can set it up, and the button changes style when its parameters have values, but you cannot trigger the action until the report is published. Microsoft's tutorial suggests publishing to the Power BI service and testing there, because that shows the most accurate experience for the people who will use it. Run a user data function from a Power BI button
What can supply a function's input?
A button, list or input slicer, a data field or a measure. A button or list slicer must be linked to a data field. An input slicer can be left unlinked, which is how you take free text. To pass one key such as a customer id, Microsoft suggests a measure using SELECTEDVALUE. Run a user data function from a Power BI button
What does the error The data source is missing credentials mean?
The published semantic model has no stored credentials for its source. Open the semantic model, select File then Settings, expand Data source credentials, select Edit credentials, choose the authentication method, for example OAuth2, and sign in. Microsoft's tutorial lists exactly these steps for the first time you open the published report. Run a user data function from a Power BI button
Why does the button show Something went wrong?
Select View details to read the reason. Microsoft lists four common causes: input that fails the function's validation rules, a timeout, a wrong button or parameter setup, and a user who is not allowed to run the function. A message you wrote with fn.UserThrownError appears in the details. Run a user data function from a Power BI button
Can a parameter be optional?
Yes. A parameter that has a default value in the user data function is optional in the report. Leave it unmapped and the default is used, or map it without forcing the reader to enter anything. An input slicer shows the default as its placeholder. Microsoft lists optional parameters and default values as generally available since May 2026. Run a user data function from a Power BI button
What happens to the button when I deploy the report to another workspace?
It keeps pointing at the original function. The button stores a fixed workspace, function set and data function, and deployment pipelines do not rebind it, even if a function with the same name exists in the target workspace. After deploying, open the button's Action settings in the target report and select the new function. Run a user data function from a Power BI button
What do I need to use Copilot in Power BI?
A workspace on a paid Fabric capacity (F2 or higher) or Power BI Premium capacity (P1 or higher), or a Fabric Copilot capacity. The capacity must be in a supported region, and the tenant setting Users can use Copilot and other features powered by Azure OpenAI must be on. Microsoft says it is on by default, but an admin can turn it off. Copilot in Power BI: what you need before it appears
Does Copilot work with a Power BI Pro or Premium Per User licence?
Not on its own. Microsoft states that a Pro or PPU licence alone is not sufficient, because Copilot requires organisational capacity. Pro and PPU workspaces do not directly support Copilot. You can still use it there if an admin sets up a Fabric Copilot capacity and assigns the workspace or you to it. Copilot in Power BI: what you need before it appears
Can I use Power BI Copilot on a trial capacity?
The Power BI pages say no: the Copilot for Power BI overview states that trial capacities and free SKUs are not supported, and a troubleshooting page explains why Copilot disappears when a Fabric trial ends. A Data Engineering Copilot page says trial capacities are supported, so Microsoft's pages differ. For Power BI, follow the Power BI pages. Copilot in Power BI: what you need before it appears
Why is the Copilot button greyed out in Power BI Desktop?
Microsoft says Desktop needs Copilot enabled through the tenant-level Fabric Copilot setting, or through the tenant admin delegation that lets capacity admins manage AI and Copilot features. If neither is on, the ribbon button shows but stays disabled. The service checks availability at workspace level, so it can behave differently. Copilot in Power BI: what you need before it appears
What is a Fabric Copilot capacity and what does it cost?
A capacity, at least F2 or P1, billed only for Copilot AI consumption such as prompt processing and responses. Downstream work, for example queries against a semantic model, is charged to the semantic model's capacity. Users assigned to it can use Copilot in Pro, PPU, Trial, Premium and Fabric workspaces. Learn gives no price, so none is stated here. Copilot in Power BI: what you need before it appears
Is the standalone Copilot in Power BI generally available?
Microsoft will retire standalone Power BI Copilot and App Copilot on 15 January 2027. The Copilot pane inside reports will remain available. For a standalone entry point, Microsoft offers a new Microsoft Copilot experience in Power BI and Fabric, currently in preview. It has its own tenant setting. Copilot in Power BI: what you need before it appears
Does Copilot send my data outside my region?
It can. If your tenant or capacity is outside the United States or EU data boundary, Copilot is disabled by default until a tenant admin turns on the setting that lets data sent to Azure OpenAI be processed outside your geographic region, compliance boundary or national cloud. The setting is under OneLake catalog, Govern, Configurations, Tenant settings. Copilot in Power BI: what you need before it appears
What are the main limits of Copilot in Power BI?
A prompt can have up to 10,000 characters. After you buy or scale capacity it can take up to 24 hours before Copilot recognises it. Multilingual use is not officially supported for the standalone and app experiences. Check the current requirements page before you plan capacity, because limits change between releases. Copilot in Power BI: what you need before it appears
How do I change the colours of a whole Power BI report?
Apply a report theme. In Power BI Desktop use the Design ribbon and pick a theme from the Themes gallery, or select Customize theme to set colours, text and visual defaults. In the Power BI service select View, then Theme. Visuals you formatted by hand keep their changes until you reset them to default. Report colours in Power BI: one theme for every visual
How do I create a custom Power BI theme file?
Write a JSON file. Only the name property is required; add dataColors for the series colours, background and foreground for structural colours, and good, neutral and bad for status colours. Then use Import theme on the Design ribbon. Power BI validates the file against a schema and shows an error for unrecognised fields. Report colours in Power BI: one theme for every visual
Why did my visual not change colour when I switched theme?
Because its colour is not a theme colour. If you pick a theme colour from the palette, the visual follows later theme changes. If you pick More colors, it stays fixed. Reset to default on the visual's formatting section returns it to the theme, but also removes conditional formatting rules and button actions on that visual. Report colours in Power BI: one theme for every visual
How do I use theme colours in conditional formatting?
Use the Field value format style and return a theme colour name from a DAX measure, such as good, neutral or bad, instead of a hexadecimal code. Colours then update automatically when you change the theme. Microsoft documents this for measures, report measures on a live connection and visual calculations. Report colours in Power BI: one theme for every visual
What contrast should report colours have?
WCAG 2.2 level AA asks for a contrast ratio of at least 4.5:1 for normal text, 3:1 for large text, and 3:1 for graphical objects and interface components against adjacent colours. In the recorded check of a six-colour sample theme on white, two data colours failed 3:1: orange #E8793A at 2.91:1 and yellow #F2C14E at 1.68:1. Report colours in Power BI: one theme for every visual
Is the Design ribbon generally available?
In Power BI Desktop, yes: the September 2026 update lists the Design ribbon for reports as generally available, with new Dark and Soft dark themes on the Versa palette. In the Power BI service the Design ribbon appears in editing mode when you turn on Try the new ribbon, which Learn labels as preview. Report colours in Power BI: one theme for every visual
What are the Dark and Soft dark report themes for?
They give a dark report canvas while you design, using the Versa colour palette and styling close to the Fluent 2 base theme. Microsoft advises selecting Reset to default before you publish, to return the report to the default light theme. They are built-in themes in the Themes gallery on the Design ribbon. Report colours in Power BI: one theme for every visual
Data scientists
How do I give Claude read-only access to a database?
Create a login only for the agent with SELECT on one schema, never your own account. In PostgreSQL that means CREATE ROLE, GRANT CONNECT, GRANT USAGE and GRANT SELECT, adapted from the current PostgreSQL documentation page (PostgreSQL 19 when checked). The SQL was not executed here, because no PostgreSQL server was available. Give Claude read-only access to your database
Is a read-only database user enough to protect my data?
No. It stops writes, but the agent can still read every column it is allowed to see, and query results can carry text that tries to instruct it. Claude Code's documentation warns that servers that fetch content can expose you to prompt injection. Keep personal columns out of the data it can read and cap the rows it gets back. Give Claude read-only access to your database
Does a view hide columns from a read-only user?
Only if the user cannot read the base table. In the project's DuckDB 2.0.1 run, a connection that could read the agent_orders view could also read the email column of the customers table behind it. Give the agent a schema or a copy that never held the column, because a view is not a boundary. Give Claude read-only access to your database
Can a read-only connection still write files?
Yes, in DuckDB 2.0.1. With only read_only=True, the run recorded a connection writing leak.csv with COPY. Setting enable_external_access to false, then lock_configuration to true, refused COPY, read_text and ATTACH. This was tested on DuckDB only, so check your own engine. Give Claude read-only access to your database
How do I keep my database password out of git when I use an MCP server?
Read it from an environment variable. Claude Code's project scope writes .mcp.json, which is shared through version control, so write the connection string as ${READONLY_DSN} instead of the password itself. The MCP entry was not executed here, and Anthropic states that it does not security-audit any MCP server, so choose one you trust. Give Claude read-only access to your database
How do I give an agent read-only access in Microsoft Fabric?
Use T-SQL: GRANT SELECT on a schema to the agent's identity and DENY SELECT on tables with personal data. The first GRANT or DENY creates the user, because CREATE USER is not available in Fabric. The identity also needs a workspace role or item Read permission. The pages carry no preview label; the SQL was not executed. Give Claude read-only access to your database
Does DENY always block access in a Fabric warehouse?
No. According to the Fabric T-SQL documentation, DENY takes precedence over other permissions, except for object owners and sysadmin members. An identity with SQL grants but no workspace role or item Read permission also cannot connect at all. These statements were adapted from Microsoft's documentation and not executed here. Give Claude read-only access to your database
How many rows should I let an AI agent read from my database?
Cap it. The project's run function returns at most 100 rows. That cap is the author's choice, not a Microsoft or Anthropic figure. Pair it with aggregated questions, so the agent returns totals instead of rows, and tell it to treat text inside query results as data, not as instructions. Give Claude read-only access to your database
How do I review SQL written by an AI before I run it?
Read it first, then check numbers, not wording. Flag any write such as INSERT, UPDATE, DELETE or DROP, read every join, count rows before and after, and reconcile one total you already trust. Run it under a read-only login on a sample. A second reviewer agent gives an opinion, not proof. How to review AI-written SQL before you trust it
How do I know a join multiplied my rows?
Count the rows of the table you started from and the rows of the joined result. For a lookup-style join the two numbers must match. In the project's DuckDB 2.0.1 run, 3 orders became 4 rows, so SUM returned 450 where the trusted total was 350. A higher count means the join key is not unique on one side. How to review AI-written SQL before you trust it
Does SELECT DISTINCT fix duplicates caused by a join?
No, it can hide them and still leave the total wrong. In the project, SUM(DISTINCT amount) returned 250 where the correct total was 350, because two orders had the same amount of 100 and collapsed into one. Aggregate the many side first, then join, which returned 350. How to review AI-written SQL before you trust it
Why does NOT EQUAL drop rows with NULL in SQL?
Because a comparison with NULL is not true, so the row is filtered out. In the project's DuckDB 2.0.1 run, with statuses paid, paid, cancelled and NULL, status <> 'cancelled' counted 2, while status IS DISTINCT FROM 'cancelled' counted 3. Read every filter for NULL before trusting a count. How to review AI-written SQL before you trust it
Why does BETWEEN lose the last day of the month?
BETWEEN includes both ends, and a bare date means midnight. In the DuckDB 2.0.1 run, BETWEEN '2026-11-01' AND '2026-11-30' counted 3 of 4 events, missing one at 16:45 on 30 November. A half-open range, created_at >= '2026-11-01' AND created_at < '2026-12-01', counted all 4. How to review AI-written SQL before you trust it
Can I see what a query cost in Fabric Warehouse?
Partly, and only afterwards. Query insights lists completed queries for 30 days, with allocated CPU time and rows returned, and queries can take up to 15 minutes to appear. The Capacity Metrics app shows when consumption happened and how much. The documentation pages do not label either as preview. This project does not measure cost. How to review AI-written SQL before you trust it
Do static SQL checks catch a fan-out join?
No. The project's static checks parse the text, and they found nothing in the fan-out query that returned 450 instead of 350. Only the row-count guard or a reconciled total shows it. Static checks are heuristics, they raise false alarms, and a clean result proves nothing. How to review AI-written SQL before you trust it
Starting out
What is medallion architecture?
A way to organise data in three steps: bronze stores data exactly as it arrived, silver fixes errors, formats and duplicates, gold shapes tables for reports. Microsoft Fabric's documentation calls it the recommended design approach. The layers describe what may change at each step, so they do not need three separate systems. Medallion architecture without overengineering
How many lakehouses do I need for a medallion architecture in Fabric?
Microsoft's page recommends one lakehouse per layer, each in its own workspace, for control and governance at layer level. It also says all lakehouses can sit in one workspace. A smaller start is one schema-enabled lakehouse with bronze, silver and gold schemas, split later when owners or security differ. Medallion architecture without overengineering
Should I clean data in the bronze layer?
No. Bronze stores data as it arrived, and Fabric's medallion page says no changes are allowed there. Keep the original text and add source, batch and load time. If bronze is edited, you lose the source of truth and cannot rebuild silver. The project's tests check that bronze keeps raw values such as a comma decimal. Medallion architecture without overengineering
What should I do with bad rows in the silver layer?
Write them to a rejects table with their raw values and the first rule they broke. Do not drop them silently. In DuckDB 2.0.1 the project keeps five rejected rows from ten, and a row count check proves every bronze row is kept, rejected or replaced. Steps 3 and 4 show the SQL. Medallion architecture without overengineering
Are materialized lake views generally available in Microsoft Fabric?
Yes for SQL-defined views, as of 2026-11-29. Microsoft's FabCon and SQLCon 2026 post, dated 18 March 2026, calls them generally available, and Learn's What's new lists them as GA. PySpark authoring is still marked preview on the overview page. Views also need a schema-enabled lakehouse. Medallion architecture without overengineering
Do I need all three medallion layers?
Not on day one. Two layers work: bronze for raw data and gold for typed, deduplicated tables and reporting tables. The project runs both variants on the same files and gets the same gold table. Add silver when a second consumer reuses the cleaned data or a different team owns it. Medallion architecture without overengineering
What is a good first data project for a portfolio?
One that answers a single clear question with a small dataset, shows how you cleaned it, and runs in minutes. The example here uses DuckDB 2.0.1 and SQL to find the top revenue category per month, rejects eight bad rows with a reason each, and ends with a README. Scope matters more than size. See the section The project. A first data project for your portfolio, from zero
How do I build a data portfolio project step by step?
Write the question, get data you may use, profile it, clean it in SQL without touching the raw file, answer with a few queries, add tests, and write a README with Question, Data, Method, Result, Limits and Next. Steps 1 to 9 of this Pattern do exactly that with DuckDB 2.0.1 and a synthetic CSV file. A first data project for your portfolio, from zero
What is the main mistake in a first data project?
In the author's opinion, starting without a question. A famous toy dataset, a notebook of charts and no stated purpose give a reviewer nothing to judge. Next come a missing README, no way to run it, and claims the data cannot support. The project here starts from one question and states in its README what the data cannot say. A first data project for your portfolio, from zero
Do I need a cloud account or a server to practise SQL?
No. DuckDB 2.0.1 installs with pip install duckdb and runs inside your Python process, so there is no database server to set up and no account to create. It reads a CSV file directly with SQL. Cloud tools such as Microsoft Fabric are a later step for a portfolio, not a requirement for a first project. A first data project for your portfolio, from zero
Can I use synthetic data in a data portfolio project?
Yes, if the README says so and you claim only the method. The generated data in this project is random, so its top category per month, for example Games in January 2026 at 1663.80, means nothing about any business. Synthetic data shows that your pipeline works; it cannot support a business conclusion. A first data project for your portfolio, from zero
Should I use SQL files or a notebook for a portfolio project?
Either can work. This is the author's choice, not a rule. The project keeps each step in a short SQL file called from a small Python script, so a reader can open one file per step in the repository and read what was done, and tests can check the result. A notebook is fine for exploring the data first. A first data project for your portfolio, from zero
Which DuckDB version and licence does the project use?
DuckDB 2.0.1, pinned in requirements.txt, released under the MIT licence according to the DuckDB project's own pages. The run was recorded on 2026-11-29 with Python 3.14.8 and pytest 9.2.0. QUALIFY and GROUP BY ALL are DuckDB syntax, and the project was not run on any other database engine. A first data project for your portfolio, from zero
Why do I hit my AI usage limit so fast?
Because on every turn the assistant re-reads everything in the conversation: its instructions, the project instructions file, earlier messages and the files it opened. In a test with Claude Code 2.1.296 and Haiku, an open request read about 9 times more tokens than a scoped one and reached the same correct answer. Long conversations and vague requests multiply the cost. Where do your AI credits go?
Is a plan or the API cheaper?
It depends on how much you use it. A ChatGPT, Claude, Gemini or GitHub Copilot plan costs the same every month and has usage limits. On the API you pay for every token: for example, Claude Haiku 5.5 costs USD 0.10 per million input tokens for prompts up to 100K tokens. For a few hours a month, the API with a spend limit fits; for daily use, a plan does. Where do your AI credits go?
Does starting a new conversation save usage?
Yes. A new conversation does not carry the history, so each turn reads much less. In a test with Claude Code 2.1.296, the same question sent at the end of a long session read about 11 times more tokens than in a fresh session. Since you lose the history, write down your decisions first. In Claude Code it is /clear; in Codex, /new; in Gemini CLI, /clear. Where do your AI credits go?
Does summarising the conversation save usage?
Partly. In Claude Code 2.1.296, /compact reads the whole conversation to summarise it, so that step uses allowance. After it, each turn starts from a shorter summary and reads less, though the summary can drop details. Codex and Copilot also have /compact, and Gemini CLI has /compress. If you switch tasks, start a new conversation. Where do your AI credits go?
Do cache reads count toward usage?
Yes, they count. The prompt cache stores text already sent so the next turn can reuse it. Reading it costs much less: OpenAI discounts it by up to 95% and Anthropic charges 0.1 times the input rate on most models. It is still not free. In a test with Claude Code 2.1.296, the same question at the end of a long session had a cost estimate about 3 times higher than in a fresh session. Where do your AI credits go?
Why was I charged for the API while on a plan?
Check whether the tool is using an API key. In Claude Code 2.1.296, if the ANTHROPIC_API_KEY environment variable is set, that key is used instead of your subscription and every token is billed to your API account. Codex and Gemini CLI also bill API-key sessions separately, at API prices rather than from your plan. Where do your AI credits go?
What do I do in ChatGPT, Gemini or Claude?
The same habits apply. In the Gemini app, Google recommends starting a new chat when you move to a new topic, and your limit is under Settings > Usage Limits. In the Claude app, long conversations that trigger automatic context management use more of your limit; usage is under Settings > Usage. In ChatGPT it is also under Settings > Usage. Keep your custom instructions short. Where do your AI credits go?
How does Free Edition differ from the Databricks free trial?
Free Edition gives you a no-cost workspace for personal learning and experiments with a serverless usage quota. Databricks also offers a time-limited free trial with separate conditions for evaluating the platform. Follow the Free Edition signup link in the official guide to get the account this exercise uses. Your first Databricks Free Edition notebook: which routes deliver late?
What can I practise in Free Edition, and what is outside it?
You can practise with Python and SQL notebooks, Unity Catalog, Delta tables and charts. Databricks also documents quota-limited jobs and experiments. Compute in Free Edition is serverless, outbound internet access is restricted, and classic clusters, R and Scala are unavailable. The account is for personal, non-commercial use. Your first Databricks Free Edition notebook: which routes deliver late?
Where can I upload the CSV if the notebook can't download it?
Upload from the workspace interface. Choose New, Add or upload data, then Upload files to a volume. Select the volume you created inside your practice schema. The notebook reads the file from the volume through Unity Catalog using the names entered in its setup fields. Your first Databricks Free Edition notebook: which routes deliver late?
Why do open shipments and invalid dates stay out of the rate?
The metric covers completed deliveries that can be compared with a promised date. Open shipments lack an actual date and invalid rows lack a usable date for the comparison. Both counts remain in the result, so readers can see how many records were excluded and why. Your first Databricks Free Edition notebook: which routes deliver late?
How can I check the rate that the notebook returns?
Start with the counts. Central has two late deliveries out of three and North one out of two. Coast has valid deliveries and none late, so it shows 0%. Remote has no eligible deliveries and its rate is empty. Running the write a second time should leave 13 shipments. Your first Databricks Free Edition notebook: which routes deliver late?
HR and people data
How do you calculate the employee turnover rate by department?
Divide the leavers in the period by the average headcount, where the average is the headcount at the start plus the headcount at the end, divided by two. In the synthetic data of this Pattern, run in DuckDB 2.0.1, 54 leavers on an average headcount of 222.0 gave 24.3% for months 25 to 36. See step 3. HR turnover for managers without exposing anyone
How can I report turnover without identifying individuals?
Publish rates for groups above a minimum size, merge smaller groups into one row, and leave out leaver counts so nobody can subtract them. Keep names, salary and health data out of the model. In the DuckDB 2.0.1 run, hiding only Legal's rate let a reader recover its single leaver; merging Legal with Finance prevented it. Not legal advice. HR turnover for managers without exposing anyone
What is the minimum group size for HR reports?
There is no universal number. Microsoft Viva Insights will not show results for groups under five people and defaults to 10 in its Copilot Dashboard, but those are product settings. The GDPR text read for this Pattern sets no group size. This Pattern uses 10 people and 5 leavers as the author's own choice; decide yours with your data protection officer. HR turnover for managers without exposing anyone
Is pseudonymised employee data still personal data under the GDPR?
Yes. Recital 26 of Regulation (EU) 2016/679 says pseudonymised data that could be attributed to a person with additional information should be considered information on an identifiable natural person. Replacing names with employee codes does not make a table anonymous, so keep employee-level rows out of shared models and exports. This is not legal advice. HR turnover for managers without exposing anyone
What is the main mistake when hiding small teams in an HR report?
Hiding one number but leaving counts and totals visible. A reader subtracts the visible groups from the company total and gets the hidden group back. In the recorded run, 54 company leavers minus 53 in the visible groups returned Legal's single leaver. Publish rates without counts, and merge small groups so no single group is pinned down. HR turnover for managers without exposing anyone
Does row-level security in Fabric solve this problem?
No. Row-level security in Fabric Data Warehouse filters which rows each user can query, using CREATE SECURITY POLICY and a predicate function. It does not decide which groups are too small to show. Apply the suppression first, then secure the published table. Microsoft's page also warns about leaks through crafted queries. The T-SQL here was not executed. HR turnover for managers without exposing anyone
Do I need a data protection impact assessment for turnover reporting?
Article 35(1) of the GDPR requires one where processing is likely to result in a high risk to the rights and freedoms of people. Whether a turnover report reaches that level is a decision for your data protection officer, and national rules differ. Document your thresholds and access rules either way. This Pattern is not legal advice. HR turnover for managers without exposing anyone