Forum Discussion

AgustinBrocardo's avatar
AgustinBrocardo
Frequent Visitor
4 years ago
Solved

Bar chart with several fields

Hi! I´m have a database for a survey where i have one question per colmn. It is refreshed every two months and this part of the database looks like this: Customers,Question1,Quesiton2,Question3,Q...
  • v-cazheng-msft's avatar
    4 years ago

    Hi AgustinBrocardo 

     

    You may try this workaround. First, you need a column containing your questions. Then you can create a Measure like this:

    QuestionAvg =

    SWITCH(

        SELECTEDVALUE(QuestionList[Question]),

        "Question1",AVERAGE('Table'[Question1]),

        "Question2",AVERAGE('Table'[Question2]),

        "Question3",AVERAGE('Table'[Question3]),

        "Question4",AVERAGE('Table'[Question4]),

        "Question5",AVERAGE('Table'[Question5])

    )

     

    The result looks like this:

    Also, attached the pbix file as reference.

     

    Best Regards,

    Community Support Team _ Caiyun

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If you still have problems on it, please feel free to let us know. Thanks a lot!