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
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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors