How DAX Difference between naked SUM and sum wrapped in CALCULATE?

0 votes

What is the difference between naked SUM and sum wrapped in CALCULATE?

Measure1 = SUM( tab[col1]) )
Measure2 = CALCULATE ( SUM( tab[col1]) ) )
Oct 8 in Power BI by anonymous
• 6,190 points
25 views

1 answer to this question.

0 votes

This is materially different than the question you asked, because you were asking about two fully defined measures, not two snippets of DAX. The measures will behave identically, because their expansions are logically equivalent:

//Measure 1 definition:
Measure1 = SUM ( 'tab'[col1] )

// Measure 1 expands to the following, and you would use this if you were
// replacing a reference with code:
//Expansion1:
CALCULATE ( SUM ( 'tab'[col1] ) )
//Measure2 definition and expansion:
Measure2 = CALCULATE ( SUM ( 'tab'[col1] ) )

//Expansion2:
CALCULATE ( CALCULATE ( SUM ( 'tab'[col1] ) ) )
answered Oct 8 by Gitika
• 50,100 points

Related Questions In Power BI

0 votes
1 answer

How to calculate cumulative Total and % in DAX?

Hi, If your table is ready with percentage ...READ MORE

answered Mar 18, 2019 in Power BI by Cherukuri
• 32,490 points
9,848 views
0 votes
1 answer

Difference between measure and calculate column in power BI

Hi Rahul,  With calculated columns, you can add new ...READ MORE

answered May 16, 2019 in Power BI by Cherukuri
• 32,490 points
5,208 views
0 votes
1 answer

How do I calculate difference between consecutive rows and columns?

There are two ways through which you ...READ MORE

answered May 20, 2019 in Power BI by avantika
• 1,500 points
7,043 views
0 votes
1 answer

How to get month name from month number in Power BI?

You can use: MonthName = FORMAT(DATE(1, [Num], 1), ...READ MORE

answered Sep 24 in Power BI by Alisha
39 views
0 votes
1 answer
0 votes
1 answer

How to ignore a slicer for one measure, but apply it on another?

In order to ignore Slicer you need ...READ MORE

answered Oct 1 in Power BI by Gitika
• 50,100 points
233 views
0 votes
1 answer

What is the difference between DAX and Power Query?

DAX stands for Data Analysis Expressions. DAX ...READ MORE

answered Sep 24 in Power BI by Gitika
• 50,100 points
30 views
0 votes
1 answer