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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Need help with bar chart

Hi, 

 

New to Power BI here. 

 

If I have 20 Likert scale survey questions, can I create a dynamic bar chart that displays the agree/disagree response count for one question at a time? i.e. if I choose "question1" it will show the response counts for question1 but no other questions. 

 

And then I can select "question2" to view only the response counts for question 2 etc.  Example image of graph below. 

 

I'm not sure whether to use a slicer or filter?

 

Thank you kindly

Anggraph.PNG

1 ACCEPTED SOLUTION
itsmebvk
Continued Contributor
Continued Contributor

@Anonymous 

 

Please watch attached video for steps. *** Note: there are many ways of doing it.

 

View solution in original post

10 REPLIES 10
VijayP
Super User
Super User

I have used a slicer and connected the slicer to the Chart with SELECTEDVALUE function. if you find this as solution , I can share the Video to understand how to do it!!

survey.gif




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!





Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Anonymous
Not applicable

@VijayP 

This looks very promising! Could you please share the video on how to do this? Thanks very much. 


@Anonymous wrote:

@VijayP 

This looks very promising! Could you please share the video on how to do this? Thanks very much. 


https://drive.google.com/open?id=1WRCzlb4lasREhUHk5ErRRMU-kAG3Krty

Please download the link of Pbix File. Will share the video in some time.

 




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


itsmebvk
Continued Contributor
Continued Contributor

@Anonymous 

 

There are many of ways of doing it. I am not infront of system, but I belive you can create two measures using follwing expression.

 

Like Count =
SWITCH(
SELECTEDVALUE([survey questions])
,1, CALCULATE(COUNT([Like and Dislike column]),FILTER(Table,[Like and Dislike column] = "Like" && [survey questions]=1))
,2, CALCULATE(COUNT([Like and Dislike column]),FILTER(Table,[Like and Dislike column] = "Like" && [survey questions]=2))
,3, CALCULATE(COUNT([Like and Dislike column]),FILTER(Table,[Like and Dislike column] = "Like" && [survey questions]=3))
, CALCULATE(COUNT([Like and Dislike column]),FILTER(Table,[Like and Dislike column] = "Like" && [survey questions]=1))
)

 

DisLike Count =
SWITCH(
SELECTEDVALUE([survey questions])
,1, CALCULATE(COUNT([Like and Dislike column]),FILTER(Table,[Like and Dislike column] = "DisLike" && [survey questions]=1))
,2, CALCULATE(COUNT([Like and Dislike column]),FILTER(Table,[Like and Dislike column] = "DisLike" && [survey questions]=2))
,3, CALCULATE(COUNT([Like and Dislike column]),FILTER(Table,[Like and Dislike column] = "DisLike" && [survey questions]=3))
, CALCULATE(COUNT([Like and Dislike column]),FILTER(Table,[Like and Dislike column] = "DisLike" && [survey questions]=1))
)

 

 

Use them in chart. Please let me know how it goes.

Anonymous
Not applicable

@itsmebvk 

Hey thanks for your reply. I'm really very new to Power BI and coding, would it be possible to break down the instructions further or link a video tutorial that demonstartes how to do this?

 

Thanks very much. 

itsmebvk
Continued Contributor
Continued Contributor

@Anonymous  I am sorry I am not sure how to create video and link. Please follow below steps.

 

1)Assume that you have following data

 

1.PNG

 

2)Then Open Power BI Desktop, create a mesure as follows

 

2.PNG

 

3) Use following expression

 

Measure = count(Sheet1[Answer])
 
4)Then select Answers and New Measure columns to chart as highlighted below
 
3.png
 
 
5) Then select slicer as highlighted in 5step, then assign Question column to this.
 
Now should be able to play with it. 
 
 
Anonymous
Not applicable

@itsmebvk 

Thanks for the instructions! Based on the below I'm thinking perhaps my data is not set up correctly for Power BI... it is currently in this format:

 

data sample.PNG

 

Will this still work for what I'm trying to do? 

Yes it will work. First UnPivot all Question Columns into One Column and follow my other instructions.

You need to create a measure the way I have created and rest the same.

 




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


itsmebvk
Continued Contributor
Continued Contributor

@Anonymous 

 

Please watch attached video for steps. *** Note: there are many ways of doing it.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.