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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.