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
ariaz
Regular Visitor

Calculated column

Hi everyone. Need help in analyzing a survey questionnaire in Power BI. I am trying to equally distribute "Netural" responses to "Agree" and "Disagree" and cannot figure it out. Can someone please suggest a solution to this. I have columns Employee ID, Country, Question and Answer in my survey. Your early response and help will never go unappreciated. Thanks

1 ACCEPTED SOLUTION
ariaz
Regular Visitor

Hi @Kishore_KVN ,
I recreated the logic to get the desired result, using your provided DAX:

AgreeColumn =
IF(Datasource[Answer]="Agree",1,IF(Datasource[Answer]="Neutral",0.5,BLANK()))
Disagreecolumn = IF(Datasource[Answer]="Disagree",1,if(Datasource[Answer]="Neutral",0.5,BLANK()))
Above two columns worked out for me.

Appreciate your help and I am closing this as "Solved" 😊

View solution in original post

3 REPLIES 3
ariaz
Regular Visitor

Hi @Kishore_KVN ,
I recreated the logic to get the desired result, using your provided DAX:

AgreeColumn =
IF(Datasource[Answer]="Agree",1,IF(Datasource[Answer]="Neutral",0.5,BLANK()))
Disagreecolumn = IF(Datasource[Answer]="Disagree",1,if(Datasource[Answer]="Neutral",0.5,BLANK()))
Above two columns worked out for me.

Appreciate your help and I am closing this as "Solved" 😊
ariaz
Regular Visitor

Hi Kishore. Let me try the solution that you provided and will mark it as "Accept as solution" if it works. Appreciate your help

Kishore_KVN
Super User
Super User

Hello @ariaz , create two columns 

1. Agree Column and its DAX will be 

Agree Column = If(Response = "Agree"||Response = "Neutral",1, Blank())

2. Disagree Column and its DAX is also the same by changing to disagree. It looks as below:

Disagree Column = If(Response = "Disagree"||Response = "Neutral",1, Blank())

 

Then in your visualization, you can use the sum to get the total values of Agree and Disagree.

 

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

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.

Top Solution Authors
Top Kudoed Authors