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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.