Loading...

Direct Lake Calculated Columns (Preview)

Direct Lake Calculated Columns (Preview)

Calculated columns are now available in preview for Direct Lake on OneLake semantic models. This has been one of the most requested capabilities since Direct Lake launched and closes a long-standing gap with Import and DirectQuery storage modes.

You can define calculated columns directly in your semantic model using DAX in web modeling and Power BI Desktop, without changing the table storage mode or modifying data upstream.

The problem this solves

Direct Lake combines Import-like performance with near real-time data freshness by querying Delta tables in OneLake and loading data into memory as needed.

But until now, if your model needed a derived column, you had only two options: push the logic upstream into the data source or move the table to a different storage mode. Calculated columns close that gap – you can now define columns directly in the semantic model using DAX without leaving Direct Lake.

What you can build

Common use cases include:

  • Derived values, such as an age calculated from a birth date.
  • Concatenating fields, such as city and region into a single field for slicers.
  • Formatted dates like Month-Year for grouping in visuals.
  • Multilingual reports using data translations with USERCULTURE().
  • Personalized content based on functions like USERPRINCIPALNAME().

Examples

1. Age = DATEDIFF( DimCustomer[BirthDate], TODAY(), YEAR )

 

2. Customer Location = DimCustomer[CityName] & ", " & DimCustomer[ContinentName]

 

3. Month Name = FORMAT( DimDate[FirstOfMonth], "mmmm", USERCULTURE() )

 

The first two return the same value for every user unless security context differs. The third adapts to the language of the person viewing the report – see Month Name.

How User Context works

Calculated columns now have a new Expression Context property. Direct Lake calculated columns support User Context expression context only.

With User Context:

  • The expression is evaluated when a user queries the model.
  • Evaluation respects row-level security (RLS) and object-level security (OLS).
  • Expressions that do not reference user-aware DAX expressions or secured columns typically return the same value for every user.

 

Considerations:

  • Cannot be used in relationships. Direct Lake calculated columns are evaluated at query time and do not materialize. Because of this, they cannot be used as relationship keys. Build relationship keys in the Delta table when needed.
  • Do not observe filter context. Calculated columns return a fixed value for each row and do not respond to report filters or slicers. Use a measure when the result must change based on report interactions.

Unlike standard calculated columns, Direct Lake calculated columns are evaluated in the current user's security context. This means calculations automatically respect RLS and OLS.

Security behavior across expression contexts

The security difference is easiest to see with a column that references a protected value. Consider a model where OLS hides DimCustomer[Education] from a "NoEducationOLS" role, and a calculated column derived from it:

  • Is Graduate = IF( DimCustomer[Education] = "Graduate Degree", "Yes", "No" )

The result depends on the expression context:

 

Import - Standard

Import - User Context

Direct Lake - User Context

Observes OLS

No

Yes

Yes

Result for a restricted user

"Yes" or "No", derived from the hidden value

Column not available

Column not available

With Standard, a restricted user still sees the derived answer and the protection is effectively bypassed. With User Context in both Import and Direct Lake, the reference to the secured column is evaluated within the user's security context, so the restricted user does not see the derived column. The sensitive value is never exposed.

 

Direct Lake – User Context Expression Context (only option available)

 

 Import – Standard Expression Context

 

 

Import – User Context Expression Context

 

 

Getting Started

Calculated columns for Direct Lake are available in preview. Open a Direct Lake on OneLake semantic model in the web or Desktop, create a calculated column, and begin modeling directly in DAX. To learn more, see the Create calculated columns in Power BI Desktop documentation.

Published on:

Learn more
Need help with this product?

We can help you with Direct Lake Calculated Columns (Preview)

If you want help implementing, troubleshooting, or improving this product, contact us and we’ll point you in the right direction.

Power BI Blog—Updates and News | Microsoft Power BI
Power BI Blog—Updates and News | Microsoft Power BI

Keep up with the latest Power BI updates, announcements, information, and new features on the Power BI blog. Search by category or date published.

Share post:

Related posts

Edit your Power BI projects anywhere and reload them instantly in Power BI Desktop (Preview)

Power BI Projects (PBIP) make reports and semantic models file-based, enabling source control, automation, and other developer workflows. You ...

6 days ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.