Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Applying 1 row value for all rows.

Table that shows answers for question of a people: _person.id_ question_ answer_ gender 1 gender? male male 1 age? 18 male 1 married? no male 2 gender? female female ...
  • rohit_singh's avatar
    rohit_singh
    4 years ago

    Hi Anonymous ,

    Here you go :

     

    __gender =

    CALCULATE(
    MAX(Gender[answer_]),
    FILTER(
    ALLEXCEPT(Gender,Gender[_person.id_]),
    Gender[question_] = "gender?"
    )
    )

     

    Kind regards,

    Rohit


    Please mark this answer as the solution if it resolves your issue.
    Appreciate your kudos! 🙂

  • v-zhangti's avatar
    4 years ago

    Hi, Anonymous 

     

    You can try the following methods.

    Measure:

    Measure =
    CALCULATE (
        MAX ( 'Table'[_answer] ),
        FILTER (
            ALL ( 'Table' ),
            [_person.id] = SELECTEDVALUE ( 'Table'[_person.id] )
                && [_question] = "gender?"
        )
    )
    

    Column:

    gender =
    CALCULATE (
        MAX ( 'Table'[_answer] ),
        FILTER (
            'Table',
            [_person.id] = EARLIER ( 'Table'[_person.id] )
                && [_question] = "gender?"
        )
    )
    

    Does it match the output you expect?

     

    Best Regards,

    Community Support Team _Charlotte

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