Forum Discussion
YashLele
1 year agoRegular Visitor
Summing units
table 1 city, nickel quantity, date Bangalore 433.00 09/06/24 Bangalore 325.00 16/06/24 Bangalore 220.00 23/06/24 Bangalore 320.00 30/06/24 Hosur 406.00 09/06/24 Hosur 193.00 ...
- 1 year ago
you can try this
Column =VAR _list=CALCULATETABLE(DISTINCT('Table'[Date]),ALLEXCEPT('Table','Table'[Plant_Name]))return sumx(FILTER('Table (2)','Table'[Plant_Name]='Table (2)'[City] && 'Table (2)'[Date] in _list), 'Table (2)'[Total Units Used])pls see the attachment below
ryan_mayu
1 year agoSuper User
what's the expected output based on the sample data you provided?
YashLele
1 year agoRegular Visitor
it should display the sum of total units used for each date of the month for each city in a column in table 1.
- ryan_mayu1 year agoSuper User
you can try this
Column = sumx(FILTER('Table (2)','Table (2)'[city]='Table'[city] && year('Table (2)'[date])=year('Table'[date])&&month('Table (2)'[date])=month('Table'[date])),'Table (2)'[units])pls see the attachment below- YashLele1 year agoRegular Visitor
Sorry if the sample data was not coherent.
I have given the data below.
date format is mm/dd/yyyy
Table 2 consists of all the dates in the month.
So i want to check the dates from table 1 and then sum the total units from table 2 corresponding to the date.Table 1
Plant_Name Week No. Quantity Date Bangalore 2 433.00 6/9/2024 Bangalore 3 325.00 6/16/2024 Bangalore 4 220.00 6/23/2024 Bangalore 5 320.00 6/30/2024 Hosur 2 406.00 6/9/2024 Hosur 3 193.00 6/15/2024 Hosur 4 278.00 6/23/2024 Table 2
City Date Total Units Used Bangalore 6/1/2024 9511 Bangalore 6/2/2024 7628 Bangalore 6/3/2024 11124 Bangalore 6/4/2024 11607 Bangalore 6/5/2024 11321 Bangalore 6/6/2024 11519 Bangalore 6/7/2024 11770 Bangalore 6/8/2024 11537 Bangalore 6/9/2024 6452 Bangalore 6/10/2024 11184 Bangalore 6/11/2024 11502 Bangalore 6/12/2024 11472 Bangalore 6/13/2024 11930 Bangalore 6/14/2024 11924 Bangalore 6/15/2024 11478 Bangalore 6/16/2024 3445 Bangalore 6/17/2024 10465 Bangalore 6/18/2024 11255 Bangalore 6/19/2024 11317 Bangalore 6/20/2024 11752 Bangalore 6/21/2024 11936 Bangalore 6/22/2024 11139 Bangalore 6/23/2024 2224 Bangalore 6/24/2024 10548 Bangalore 6/25/2024 11663 Bangalore 6/26/2024 12685 Bangalore 6/27/2024 9941 Bangalore 6/28/2024 10578 Bangalore 6/29/2024 11184 Bangalore 6/30/2024 6952 Hosur 6/1/2024 5472 Hosur 6/2/2024 10114 Hosur 6/3/2024 10904 Hosur 6/4/2024 11076 Hosur 6/5/2024 10744 Hosur 6/6/2024 10678 Hosur 6/7/2024 10848 Hosur 6/8/2024 10578 Hosur 6/9/2024 8162 Hosur 6/10/2024 10350 Hosur 6/11/2024 10734 Hosur 6/12/2024 11358 Hosur 6/13/2024 11220 Hosur 6/14/2024 10962 Hosur 6/15/2024 6652 Hosur 6/16/2024 10992 Hosur 6/17/2024 11198 Hosur 6/18/2024 11064 Hosur 6/19/2024 11166 Hosur 6/20/2024 9800 Hosur 6/21/2024 11352 Hosur 6/22/2024 9000 Hosur 6/23/2024 2280 Hosur 6/24/2024 8790 Hosur 6/25/2024 11430 Hosur 6/26/2024 11484 Hosur 6/27/2024 11682 Hosur 6/28/2024 11424 Hosur 6/29/2024 11222 Hosur 6/30/2024 2496 - ryan_mayu1 year agoSuper User
you can try this
Column =VAR _list=CALCULATETABLE(DISTINCT('Table'[Date]),ALLEXCEPT('Table','Table'[Plant_Name]))return sumx(FILTER('Table (2)','Table'[Plant_Name]='Table (2)'[City] && 'Table (2)'[Date] in _list), 'Table (2)'[Total Units Used])pls see the attachment below