Forum Discussion

Arioli_Chezhian's avatar
3 years ago
Solved

Create calculated column in Live connection

Hello All,

I have 2 tables, Table 1 is live connection(Using existing dataset) and Table 2 is import file. The Employee ID present in import file should be shown as "Flag - Internal", and for other records should be shown as "External" or "Blank". 

We have to bring that Flag column from table 2 to table 1. Using RELATED function we can achieve this but since Table 1 is live connection unable to create Calculate column and Calculate Table.
Using relationship between these 2 table if we directly drag and drop the Flag column in a table visual, data will filtered out where Flag = Internal. Flag = External won'tbe appeared in the visual.  I believe it should be handled in Measure. 

Please advice how to achieve this measure. 

  • Mahesh0016's avatar
    Mahesh0016
    3 years ago

    Arioli_Chezhian  Please Try This one.

    Flag =
    IF (
        SELECTEDVALUE ( 'Table 1'[Emp ID] ) = MAX ( 'Table 2'[Emp ID] ),
        "Internal",
        "External"
    )

     

     

14 Replies

      • Mahesh0016's avatar
        Mahesh0016
        Super User

        Arioli_Chezhian I hope this helps you. Thank you.

        >Create Following Measures :
        Tbl1 =
        SUM ( 'Table Workspace'[Emp ID] )
        #################################
        Tbl2 =
        SUMX ( 'Table Flag', [Tbl1] )
        ################################
        Flag =
        IF ( [Tbl1] = [Tbl2], "Internal", "External" )