Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
wpf_
Post Prodigy
Post Prodigy

How does calculated columns work in directquery?

So if i understand correctly, for import mode, calculated columns are loaded into the model during a data refresh.  And once it's loaded any queries are to the calculated column stored within the local bi file. 

 

But what happens with calculated column in directqueries?  Are calculated columns persisted in the data source and when we refresh the visuals it queries the data source every time?  

 

I have created a custom column through power query vs calculated column for directquery and it seems like the calculated column is slower for the report. Any clarifications would help. Thanks. 

1 ACCEPTED SOLUTION

@wpf_ That is exactly what I think happens behind the scenes, yes.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Syndicate_Admin
Administrator
Administrator

Hello good morning, the calculated column can be used as the end of a relationship in a composite model?

Greg_Deckler
Super User
Super User

@wpf_ I don't believe that the values are persisted in the data model or the data source. For example, I added a calculated column to a DirectQuery model and it added a total of about 600 bytes to the data model and added nothing to the data source. So, likely it just stores the formula for the calculated column in the PBIX file in the Data Model.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

 

Thank you.  

So does that mean that every time I refresh a visual that contains a measure that references a calculated column, it queries the data source  and calculates the calculated column then the measure on demand?

@wpf_ That is exactly what I think happens behind the scenes, yes.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

Makes sense.  I guess that’s why the calculated column version I had took longer then the custom column version. Thanks!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.