Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
AgustinBrocardo
Frequent Visitor

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,Question4,Question5

Customer1,3,3,3,3,3

Customer2,4,4,3,4,3

Customer3,5,3,4,2,4 

 

The answers are numbers from 1 to 5 and i want to make a bar/column chart where each column of the char represents the average answer for each question.

 

In power bi, without editing the imported data, i have one field for each column: 

AgustinBrocardo_0-1635960577356.png

 

 

Is there a way to add each question as a separate column in the bar chart?

 

The solution i found is unpivoting the question columns but it´s a problem because i need to use the individual questions for other visuals and analysis. In reality i have around 70 questions (70 columns) and i need to do this same process with other groups of questions, unpivoting is not an option because if i do it for every group, the power query model becomes too big.

1 ACCEPTED SOLUTION
v-cazheng-msft
Community Support
Community Support

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:

vcazhengmsft_0-1636098472097.png

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!

 

View solution in original post

3 REPLIES 3
v-cazheng-msft
Community Support
Community Support

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:

vcazhengmsft_0-1636098472097.png

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!

 

Thanks! it worked perfectly!

Hi @AgustinBrocardo 

 

That's great! Thanks for your feedback!

 

Best Regards,

Community Support Team _ Caiyun

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.