Forum Discussion

TcT85's avatar
TcT85
Icon for Helper III rankHelper III
2 years ago
Solved

If the value from first column is missing in the second column the show value from column 1

Hi,

Is this possible?

If the value from first column is missing in the second column the show value from column 1.

I have 2 tables

 

Table 1 Serial number
11
12
13
14
15
16
17

 

Table 2 Serial number
11
12
14
15
16

 

Result that I want.

New Column
13
17
 
 
  • TcT85 

    sample data : 

     

    output 

     

    measure

    Measure 13 = 
    var ds = 
    EXCEPT(
        values(tbl_1[col1]),values(tbl_2[col2])
    )
    return
    CALCULATE(
        COUNTROWS(tbl_1),
        KEEPFILTERS(ds)
        )

     

     

    if you dont want to use a measure . you can simply refer to the below  method : 

    output

     

    Measure 13 = 
    var ds = 
    EXCEPT(
        values(tbl_1[col1]),values(tbl_2[col2])
    )
    var c = 
    CALCULATE(
        COUNTROWS(tbl_1),
        KEEPFILTERS(ds)
        )
    
    
    return if(ISBLANK(c), 0,1)

     

     

     

     

    let me know if it works for you . 

     

     

     

    If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
    It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

     

2 Replies

  • Daniel29195's avatar
    Daniel29195
    Icon for Community Champion rankCommunity Champion

    TcT85 

    sample data : 

     

    output 

     

    measure

    Measure 13 = 
    var ds = 
    EXCEPT(
        values(tbl_1[col1]),values(tbl_2[col2])
    )
    return
    CALCULATE(
        COUNTROWS(tbl_1),
        KEEPFILTERS(ds)
        )

     

     

    if you dont want to use a measure . you can simply refer to the below  method : 

    output

     

    Measure 13 = 
    var ds = 
    EXCEPT(
        values(tbl_1[col1]),values(tbl_2[col2])
    )
    var c = 
    CALCULATE(
        COUNTROWS(tbl_1),
        KEEPFILTERS(ds)
        )
    
    
    return if(ISBLANK(c), 0,1)

     

     

     

     

    let me know if it works for you . 

     

     

     

    If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
    It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠