A calculated field defined in a published data source uses a user function (for example USERNAME()) nested inside a Level of Detail (LOD) expression. The field looks valid while editing the data source and validates in Tableau Desktop, but it does not surface in the data pane when a new workbook is created from the published data source or when using web authoring.
This is expected behavior, not a defect. It occurs specifically when the user function is nested inside the LOD; a plain user-function calculation, or an LOD without a user function, publishes and appears normally.
Workarounds:
1. Rework the calculation so the user-function logic sits outside the LOD. Compute a per-user flag first, then aggregate that flag.
- Create a field such as: `IsUser = IF USERNAME() = [Owner] THEN 1 ELSE 0 END`
- Then reference it inside the LOD: `{ FIXED [Region] : SUM([IsUser]) }`
2. Alternatively, keep the data source embedded in the workbook instead of publishing it standalone. Embedded data sources retain viewer context and work as expected.
3. Alternatively, build the calculated field inside the workbook rather than the published data source, or handle row-level security at the workbook level (or via an entitlements/mapping table).
**Why:** A user function resolves per viewing user and needs live session/user context. When a data source is embedded, that context is present. When it is published standalone, it is treated as shared and is often evaluated at extract-refresh time, where no individual user context exists — so a user function nested inside an LOD cannot resolve and the field becomes invalid. It can still look valid in Tableau Desktop, which is why it appears in the data source edit view but not in a new workbook. Recent versions (2025.1+) validate this more strictly than before, so calculations that previously slipped through are now blocked.
Level of Detail Expressions — Limitations
https://help.tableau.com/current/pro/desktop/en-us/calculations_calculatedfields_lod_overview.htm#limitations-for-level-of-detail-expressions
Create User Filters and Restrict Access
https://help.tableau.com/current/pro/desktop/en-us/publish_userfilters_create.htm
005460008

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.