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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Mahar92
Frequent Visitor

Calculate() + Filter() not working as expected

Hi,

 

in my Pivot table I want to display the sales for the first year (2014) irrespective of the current filter context (so even in the section for year 2015 I want to display the sales for 2014).

 

To achieve this, I would assume that I could use both of the following DAX measures:

=CALCULATE([Total Sales],qryCalendar[Year]=2014)

 

=CALCULATE([Total Sales],Filter(qryCalendar,qryCalendar[Year]=2014))

 

However, only the first of the two works as expected (first picture). The second one that uses Filter() only returns blank cells in all sections other than 2014

Can anyone tell me why it is not working for me?

 

Calculate()Calculate()Calculate() + Filter()Calculate() + Filter()

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @Mahar92 

 

try this=
=CALCULATE([Total Sales],Filter(all(qryCalendar),qryCalendar[Year]=2014))

 

Did I answer your question? Mark my post as a solution!

Appreciate your Kudos VahidDM_0-1630078242905.png !!

View solution in original post

2 REPLIES 2
Mahar92
Frequent Visitor

That did the trick. Thank you!

VahidDM
Super User
Super User

Hi @Mahar92 

 

try this=
=CALCULATE([Total Sales],Filter(all(qryCalendar),qryCalendar[Year]=2014))

 

Did I answer your question? Mark my post as a solution!

Appreciate your Kudos VahidDM_0-1630078242905.png !!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.