Forum Discussion

dofrancis3's avatar
dofrancis3
Resolver I
1 year ago
Solved

Icon

Dear Colleagues;   I reach out to you to request your support 1. I have the data set below: Did you receive your salary? Yes Yes Yes No Yes No No No Yes Yes No...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Thanks for the reply from xifeng_L , please allow me to provide another insight: 
    Hi  dofrancis3 ,

     

    Here are the steps you can follow:

    1. Create calculated table.

    Table 2 =
    var _table=
    SUMMARIZE(
        'Table',[Did you receive your salary?],"Count",COUNTX('Table',[Did you receive your salary?]))
    var _yes=
    SUMX(FILTER(_table,[Did you receive your salary?]="Yes"),[Count])
    VAR _NO=
    SUMX(FILTER(_table,[Did you receive your salary?]="No"),[Count])
    VAR _table2=
    SELECTCOLUMNS(
    _table ,
        "Yes",IF(_yes>=_NO,1,0),
        "No",IF(_NO>_yes,1,0))
    return
    DISTINCT(
        _table2)

    2. Result:

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly