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.
Hello,
Short of making dozens and dozens of small formulas is there an effective way to calculate a weighted average for each question in survey data. I want to use these weighted average answers as sources for various graphs in Power Bi.
Sample Data:
It is a survey format so there may be multiple responses for a particular candidate, in this case BOB had 3, JANE had 2. (I'll be using a slicer to filter by candidate name)
Answers are text format and I need to assign them weighting in the formula, For exmaple, Excellent = 3 points, Average = 2 points, Poor = 1 point
I need to calculate the weighted average for each candidate, for each question.
Spent so much time trying different formulas and browsing on this forum but can't seem to find a similar situation. Any help is much appreciated! (ChatGPT actually got me halfway there!)
Candidate Name | Question 1 | Question 2 | Question 3 |
BOB | Excellent | Average | Average |
BOB | Average | Poor | Poor |
BOB | Poor | Excellent | Excellent |
JANE | Excellent | Excellent | Poor |
JANE | Average | Average | Excellent |
Solved! Go to Solution.
hi @hgmc
the point is to unpivot your data and add a custom column into a table like this:
CandidateName Question Answer Point
BOB Question1 Excellent 1
BOB Question2 Average 2
BOB Question3 Average 2
...
then everything becomes intuitive with DAX.
About unpivot:
https://learn.microsoft.com/en-us/power-query/unpivot-column
1) use conditional formatting for assigning values to the questions.
2) use the below measure.
4) similarly you can do it for question 2 and 3
if this solves your issue please accept my answer as solution.
hi @hgmc
the point is to unpivot your data and add a custom column into a table like this:
CandidateName Question Answer Point
BOB Question1 Excellent 1
BOB Question2 Average 2
BOB Question3 Average 2
...
then everything becomes intuitive with DAX.
About unpivot:
https://learn.microsoft.com/en-us/power-query/unpivot-column
Thank-you, looked a bit daunting at first to unpivot as I didnt really understand what I was doing but it did work in the end!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
37 | |
25 | |
19 | |
14 | |
8 |
User | Count |
---|---|
68 | |
48 | |
45 | |
18 | |
15 |