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.
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!
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 |
---|---|
114 | |
104 | |
77 | |
67 | |
63 |
User | Count |
---|---|
144 | |
107 | |
105 | |
82 | |
69 |