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

View all the Fabric Data Days sessions on demand. View schedule

Reply
mdaamirkhan
Post Prodigy
Post Prodigy

Need help in dax query to show next year value

Hi 

Need help in dax query to show next year value below is thw screenshot.

 

I am trying to show two year value 

2021 --> value is showing correctly 5
2022--> its showing wrong value. it should show 2

 

Can you please provide the dax

Capture.JPG

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @mdaamirkhan ,

 

Without any data and data model is difficult to give the correct formula, but believe that the issue ios on your filtering.

 

Since you are doing a filter on a tabvle when you do a simple FILTER(TABLE)) this will return the current context in this case you will be looking at current year only. You need to do a FILTER(ALL(Table)).

 

So you measure should look similar to this:

Estimated this year + 1 =
var thisyear = Year(now()) + 1
var NSM = DISTINCTCOUNT(Input_Contract_Report[months])
var val =
CALCULATE(NSM
,
FILTER( ALL(Input_Contract_Report), Input_Contract_Report[End Date].[Year] = thisyear

)
Return
val

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @mdaamirkhan ,

 

Without any data and data model is difficult to give the correct formula, but believe that the issue ios on your filtering.

 

Since you are doing a filter on a tabvle when you do a simple FILTER(TABLE)) this will return the current context in this case you will be looking at current year only. You need to do a FILTER(ALL(Table)).

 

So you measure should look similar to this:

Estimated this year + 1 =
var thisyear = Year(now()) + 1
var NSM = DISTINCTCOUNT(Input_Contract_Report[months])
var val =
CALCULATE(NSM
,
FILTER( ALL(Input_Contract_Report), Input_Contract_Report[End Date].[Year] = thisyear

)
Return
val

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.

Top Solution Authors
Top Kudoed Authors