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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Create Measure

Hi, How can I create a measure to calculate the sum of sales filtered by the Year 2017?  

 

 

 

1 ACCEPTED SOLUTION
vivran22
Community Champion
Community Champion

@Anonymous 

 

If you add a calendar table/date table in the data model and relate it to with the sales table, then the following formula will work

 

 

CALCULATE(SUM(TableName[Sales]), dtCalendar[Year] = 2017)

 

https://www.vivran.in/post/power-bi-time-intelligence-calendar-table

 

Cheers!
Vivek

If it helps, please mark it as a solution. Kudos would be a cherry on the top 🙂
If it doesn't, then please share a sample data along with the expected results (preferably an excel file and not an image)

Blog: vivran.in/my-blog
Connect on LinkedIn
Follow on Twitter

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , TRy like

 

calculate(sum(sales[Amount]), filter(Sales, year(Sales[Date]) = 2017))
or with date table
calculate(sum(sales[Amount]), filter(Date, year(Date[Date]) = 2017))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Sales 2017 = CALCULATE(SUM('Revenue Table'[Revenue]),'Date'[Year]=2017) 
That's right?
vivran22
Community Champion
Community Champion

@Anonymous 

 

If you add a calendar table/date table in the data model and relate it to with the sales table, then the following formula will work

 

 

CALCULATE(SUM(TableName[Sales]), dtCalendar[Year] = 2017)

 

https://www.vivran.in/post/power-bi-time-intelligence-calendar-table

 

Cheers!
Vivek

If it helps, please mark it as a solution. Kudos would be a cherry on the top 🙂
If it doesn't, then please share a sample data along with the expected results (preferably an excel file and not an image)

Blog: vivran.in/my-blog
Connect on LinkedIn
Follow on Twitter

Anonymous
Not applicable

Thank you for your help 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors