Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I am doing a survey analysis in which each participant is identified by a unique identifier called "ID". The table contains the following cols:
What I want to do is create 2 new columns: "Wellbeing Average" and "is Favorable" for each participant ID. The first metric is supposed to calculate the average of scores received in all questions per participant that are have category = "wellbeing". The second metric is basically a condition which should return TRUE if the average is >= 4, else FALSE. For example, the output should look like this
Desired Output:
Below is the snapshot of table
by the way, Tableau has a very straightforward calc for this i.e.
{FIXED ID: AVERAGE (IF CATEGORY = "Wellbeing" THEN SCORE RETURN)}
but a similar version in PowerBI is unbelievingly confusing to find! please help so I can learn this.
Solved! Go to Solution.
Hi ,
In PowerBI you have a function that is call CALCULATE.With this function you can modify the context in which a expression is evaluated,
In your scenario, you want to evaluate the expression "Average":
Average_Wellbeing = AVERAGE('Table'[Score])
But, you want to evaluate this expression in a certain context, so, with CALCULATE:
CALCULATE(AVERAGE('Table'[Score]),'Table'[Category]="Wellbeing")
Replacing 'Table' by your Table Name.
Hope it helps!
yes this helps! thank you so much.
Hi ,
In PowerBI you have a function that is call CALCULATE.With this function you can modify the context in which a expression is evaluated,
In your scenario, you want to evaluate the expression "Average":
Average_Wellbeing = AVERAGE('Table'[Score])
But, you want to evaluate this expression in a certain context, so, with CALCULATE:
CALCULATE(AVERAGE('Table'[Score]),'Table'[Category]="Wellbeing")
Replacing 'Table' by your Table Name.
Hope it helps!
User | Count |
---|---|
98 | |
91 | |
84 | |
71 | |
67 |
User | Count |
---|---|
114 | |
103 | |
100 | |
72 | |
64 |