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! Request now

Reply
sgupta22
Helper II
Helper II

Return value for a specific year and not sum of all years

I am using the following code to return the value for the first year of the slicer.  However, the value returns as the sum of all years. What am I doing wrong? Any help is appreciated! 

 

 

BeginningValue =
     VAR BeginningDate = CALCULATE(MIN('Calendar'[Year]), ALLSELECTED('Calendar'[Year]))
RETURN
     CALCULATE(SUM(Data1[Total Revenue]), FILTER('Calendar', 'Calendar'[Date] = BeginningDate))

 

 

Cheers

Shashank

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @sgupta22 

 

You can try the following methods.
Sample data:

vzhangti_3-1673852069069.png

BeginningValue = 
     VAR BeginningDate = CALCULATE(MIN('Calendar'[Year]), ALLSELECTED('Calendar'[Year]))
RETURN
     CALCULATE(SUM(Data1[Total Revenue]), FILTER('Data1', YEAR([Date]) = BeginningDate))

vzhangti_2-1673852038971.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @sgupta22 

 

You can try the following methods.
Sample data:

vzhangti_3-1673852069069.png

BeginningValue = 
     VAR BeginningDate = CALCULATE(MIN('Calendar'[Year]), ALLSELECTED('Calendar'[Year]))
RETURN
     CALCULATE(SUM(Data1[Total Revenue]), FILTER('Data1', YEAR([Date]) = BeginningDate))

vzhangti_2-1673852038971.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mangaus1111
Solution Sage
Solution Sage

Hi @sgupta22 ,

try to substitute 

 'Calendar'[Date] = BeginningDate)  with

'Calendar'[Year] = BeginningDate) 

Thanks for your reply Mangaus.  Still doesn't work unfortunately.

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