Forum Discussion
CPaceFOTL
8 years agoFrequent Visitor
New Column with value of another table based on a date range from date in initial table
All, I have been searching and looking at calculated columns and LOOKUPVALUE; however, have not gotten anything to work like I am seeing. I have two tables (Table1 & Table2). Table1 is a ...
- 8 years ago
Hi CPaceFOTL,
Try out this formula please.
Column = VAR temp = CALCULATE ( SUM ( Table1[Daily_Cost] ), FILTER ( Table1, 'Table1'[Start] <= [CreatedDate] && 'Table1'[End] >= [CreatedDate] ) ) RETURN IF ( ISBLANK ( temp ), CALCULATE ( SUM ( Table1[Daily_Cost] ), 'Table1'[End] = BLANK () ), temp )Best Regards,
Dale
- 8 years ago
v-jiascu-msft
Microsoft Employee
8 years agoHi CPaceFOTL,
Try out this formula please.
Column =
VAR temp =
CALCULATE (
SUM ( Table1[Daily_Cost] ),
FILTER (
Table1,
'Table1'[Start] <= [CreatedDate]
&& 'Table1'[End] >= [CreatedDate]
)
)
RETURN
IF (
ISBLANK ( temp ),
CALCULATE ( SUM ( Table1[Daily_Cost] ), 'Table1'[End] = BLANK () ),
temp
)
Best Regards,
Dale
CPaceFOTL
8 years agoFrequent Visitor
I am trying to insert the new Custom Column; however, I am getting the error message Token Eof expected. When I click on the Show error hyperlink, it is pointing me to the temp on the VAR statement. Any ideas?
Thanks,
Craig Pace
- v-jiascu-msft8 years ago
Microsoft Employee