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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Reddyp
Helper I
Helper I

Sales for particular year_DAX query help

1. I want help in writing DAX for calculating "sales" for particular year (example:sum of sales where year  = ‘1900-01-01 00:00:00')

2. for the above DAX formula I need to add "location" of store, ("sales" for particular year where location is "Auckland")

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @Reddyp ,

 

You could try below code:-

CALCULATE (
    SUM ( Table1[Amount] ),
    FILTER ( Table1, Table1[Date] = DATE ( 1900, 01, 01 ) ),
    FILTER ( Table2, Table2[Location] = "Auckland" )
)

 

BR,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

3 REPLIES 3
Samarth_18
Community Champion
Community Champion

Hi @Reddyp ,

 

You could try below code:-

CALCULATE (
    SUM ( Table1[Amount] ),
    FILTER ( Table1, Table1[Date] = DATE ( 1900, 01, 01 ) ),
    FILTER ( Table2, Table2[Location] = "Auckland" )
)

 

BR,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

amitchandak
Super User
Super User

@Reddyp ,

calculate( sum(Table[Amount]), filter(Table, Table[Date] = date(1900,01,01)  && Table[Location] = "Auckland") )

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

@amitchandak this can't be worked when "Location" details are on different table (Table 2) right ?

calculate( sum(Table1[Amount]), filter(Table1, Table[Date] = date(1900,01,01)  && Table1[Location] = "Auckland") )

help me out in applying filter on columns from different tables 

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.