cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Frequent Visitor

## Need to calculate weighted average based on derived values.

Hi All,

There is a scenario as:

 Input Data Question category Question Rating A1 Q1 1 A1 Q1 1 A1 Q1 1 A1 Q1 2 A1 Q1 2 A1 Q1 2 A1 Q1 3 A1 Q1 3 A1 Q1 3 A1 Q1 3 A1 Q1 0 A1 Q1 0 A1 Q2 1 A1 Q2 1 A1 Q2 2 A1 Q2 2 A1 Q2 2 A1 Q2 2 A1 Q2 3 A2 Q1 3 A2 Q1 3 A2 Q1 3 A2 Q1 4 A2 Q1 4 A2 Q1 4 A2 Q2 0 A2 Q2 0 A2 Q2 1 A2 Q2 1 A2 Q2 2 A2 Q2 2 A2 Q2 2 A2 Q2 2

Calculation and output will be like below:

 Output Calculation Rating Weight Calculation Final Output A1 Q1 1 3 1*3=3 3+6+12/10 A1 Q1 2 3 2*3=6 A1 Q1 3 4 3*4=12 A1 Q1 0 0 A1 Q2 1 2 1*2=2 2+8+3/7 A1 Q2 2 4 2*4=8 A1 Q2 3 1 3*1=3 A2 Q1 3 3 3*3=9 9+12/6 A2 Q1 4 3 4*3=12 A2 Q2 0 0 0 A2 Q2 1 2 1*2=2 2+8/6 A2 Q2 2 4 2*4=8
Super User

@kirti_agarwal28 , Try a measure like

divide(calculate(sum(Table[Rating]), filter(Table, Table[Rating]>0)),calculate(count(Table[Rating]), filter(Table, Table[Rating]>0)))

Announcements

#### Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors