Forum Discussion
Calculate a sum in a table with visual filter
Hello,
i'm trying to calculate sum's for each row of the table (MetaP1 value) below. The values are filtered with the date slicers on the left.
The data i need to sum is in another table as below:
to summarize, what i want to do is:
for the date slice 01/01/2022 ~ 01/02/2022, get the sum of the [Meta] values of the second table filtered with the [Data] value and for each [Client] in the first table.
Example: table 2:
| Client | Date | Meta |
| A | 01/01/2023 | 100 |
| A | 02/01/2023 | 100 |
| A | 03/01/2023 | 100 |
| A | 04/01/2023 | 100 |
| A | 05/01/2023 | 100 |
| B | 01/01/2023 | 100 |
| B | 02/01/2023 | 100 |
| ... | ... | ... |
Data range 01/01/2023 to 05/01/2023:
Client A: 500
Client B: 200 + .... but the result appearing in the first table
Thank you!
Anonymous , You have to create measure for that. Assuming filter on an independent table
//Date1 is independent Date table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = minx(allselected(Date1),Date1[Date])
return
calculate( sum(Table[Value]), filter('Table', 'Table'[Date] >=_min && 'Table'[Date] <=_max))
2 Replies
- amitchandak
Super User
Anonymous , You have to create measure for that. Assuming filter on an independent table
//Date1 is independent Date table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = minx(allselected(Date1),Date1[Date])
return
calculate( sum(Table[Value]), filter('Table', 'Table'[Date] >=_min && 'Table'[Date] <=_max))- AnonymousNot applicable
Thank you for the reply!
It worked like a charm, thank you!