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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
jzhao
Frequent Visitor

is function filter and the filter expression in calculate function the same?

I want to sum up sales with same store ID, are the following calculated columns interchangeable? They did give me the same result so far.
Method 1:
Sales =
var curid ='table1'[ID]
return SUMX(FILTER('table2',curid='table2'[ID]),'table2'[Sales__Local_currency])
 
Method2:
Sales 2 = CALCULATE(SUMX('table2','table2'[Sales__Local_currency]), 'table1'[ID]=RELATED('table2'[ID]))

1 REPLY 1
Abhinav054
Helper I
Helper I

The main difference between the FILTER() function and the filter expression in the CALCULATE() function is that the FILTER() function returns a new table, while the filter expression in the CALCULATE() function modifies the filter context of the current calculation. I think method 2 is better

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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