Forum Discussion

CPaceFOTL's avatar
CPaceFOTL
Frequent Visitor
8 years ago
Solved

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 ...
  • v-jiascu-msft's avatar
    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
        )

    New_Column_with_value_of_another_table_based_on_a_date_range_from_date_in_initial_table

     

    Best Regards,

    Dale

  • v-jiascu-msft's avatar
    v-jiascu-msft
    8 years ago

    Hi CPaceFOTL,

     

    You need to add it in the data view rather than the Query Editor.

    New_Column_with_value_of_another_table_based_on_a_date_range_from_date_in_initial_table2

     

     

    Best Regards,

    Dale