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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
UsePowerBI
Post Prodigy
Post Prodigy

What are the use cases to choose CALCULATETABLE over CALCULATE?

Hello

 

Why would you choose CALCULATETABLE over CALCULATE?

I understand the first returns a table and the second a column, but can you describe some situations that the first is better or the only option to calculate something?

 

Thanks!

1 ACCEPTED SOLUTION
eliasayyy
Super User
Super User

i personally mostly use calculate table inside big measure that  i need to include VAR with summarize or the x funtions like SUMX , MAXX... and so on or to create virtual relatiosnhips or generate temp table or you wnat to compare measure vs measure in table visual..

for example i need to deeply filter my table before summarizein gso i do 

VAR = SUMMARIZE(
CALCULATETABLE(...

or i want my top 10 inside a table

CALCULATETABLE( TOPN( 10, ...)..

while calculate i only use for apllying filter sto my expressions and they dont need deep understanding

more over , CALCULATE modifies a single value (or an aggregate value), whereas CALCULATETABLE returns an entire table.

View solution in original post

3 REPLIES 3
eliasayyy
Super User
Super User

i personally mostly use calculate table inside big measure that  i need to include VAR with summarize or the x funtions like SUMX , MAXX... and so on or to create virtual relatiosnhips or generate temp table or you wnat to compare measure vs measure in table visual..

for example i need to deeply filter my table before summarizein gso i do 

VAR = SUMMARIZE(
CALCULATETABLE(...

or i want my top 10 inside a table

CALCULATETABLE( TOPN( 10, ...)..

while calculate i only use for apllying filter sto my expressions and they dont need deep understanding

more over , CALCULATE modifies a single value (or an aggregate value), whereas CALCULATETABLE returns an entire table.

aj1973
Community Champion
Community Champion

Hi @UsePowerBI 

https://www.sqlbi.com/tv/calculate-calculatetable-dax-guide/

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

R1k91
Continued Contributor
Continued Contributor

I don't think it's correct to say CALCULATE evaluates a column.

CALCULATE produces a scalar value. if you project that calculate (using a measure for example) in a table it will "resamble" to a column but it remains a scalar computation executed multiple times in different filter context.

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.