Forum Discussion
Anonymous
7 years agoNot applicable
Calculated column for each row across multiple tables
Hi everyone, I have a table 'ClientInfo' which has (among others) three columns: BeginDate, EndDate, TotalCostsPerDay. Additionally, I have a table called 'DateValues' which has a column called '...
Stachu
Community Champion
7 years agotry this as a calculated column in 'DateValues'
AggregateCostPerDay =
VAR __Date = 'DateValues'[Dates]
VAR __ClientInfo =
FILTER (
'ClientInfo',
'ClientInfo'[BeginDate] <= __Date
&& 'ClientInfo'[EndDate] >= __Date
)
RETURN
SUMX ( __ClientInfo, [TotalCostsPerDay] )if it doesn't work - can you add sample tables (in format that can be copied to PowerBI) from your model with anonymised data? Like this (just copy and paste into the post window).
| Column1 | Column2 |
| A | 1 |
| B | 2.5 |