Forum Discussion
Reddyp
Helper I
4 years agoSales 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")
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
3 Replies
- amitchandak
Super User
Reddyp ,
calculate( sum(Table[Amount]), filter(Table, Table[Date] = date(1900,01,01) && Table[Location] = "Auckland") )
- Reddyp
Helper I
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
- Samarth_18
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