cancel
Showing results for
Did you mean:
Frequent Visitor

## Modify Value in row based on value in other row

Hello Power BI Community,
I have a table that looks like following. Example data set is found at the end.

| Student_Number | Exam_Number | Score1 | Score2 |

I am wanting to calculate / graph statistics based on this data set.
1. The average score of each exam
2. Rank exams based on sum of all Score1s in ascending order (Add all available score1 per exam. Rank them in ascending order)
3. Rank exams based on sum of Score2s in ascending order
4. After ranking the sum of exam scores, perform percentile calculation to find out what P10,50,90 scores are

I am very new to Power BI. I appreciate any advice on what I should read and how I can get started
Thank you,

 Student Number Exam Number Score1 Score2 1 0 64 .. 2 0 90 .. 3 0 21 .. 1 1 22 .. 2 1 42 3 1 83 1 2 72 2 2 20 3 2 70 1 3 42 2 3 89 3 3 69
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team

## Re: Modify Value in row based on value in other row

Hi @tk0501

Create measures

```average score1 = CALCULATE(AVERAGE(Table1[Score1]),ALLEXCEPT(Table1,Table1[Exam Number]))

sum score1 = CALCULATE(SUM(Table1[Score1]),ALLEXCEPT(Table1,Table1[Exam Number]))

rank score1 = RANKX(ALL(Table1),[sum score1],,ASC,Dense)```

Best Regards
Maggie

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 REPLIES 2
Community Support Team

## Re: Modify Value in row based on value in other row

Hi @tk0501

Create measures

```average score1 = CALCULATE(AVERAGE(Table1[Score1]),ALLEXCEPT(Table1,Table1[Exam Number]))

sum score1 = CALCULATE(SUM(Table1[Score1]),ALLEXCEPT(Table1,Table1[Exam Number]))

rank score1 = RANKX(ALL(Table1),[sum score1],,ASC,Dense)```

Best Regards
Maggie

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Frequent Visitor

## Re: Modify Value in row based on value in other row

Thank you so much, Maggie @v-juanli-msft

This looks to be the solution I was looking for.

Say I have expanded this dataset to 10,000 exams and 5 students. (the actual model is 10,000 iteration simulation)

Does using measures still make sense in that scenario?

I will be using this Power BI using a standard 2019 consumer laptop (not a data server)

In addition, I'm now working on a visualization of the data.

I would like [Staked Area Chart] of...

• Axis - Rank Score1
• Values - Each student's score for a given exam

For example - Exam #1 was the highest ranked exam.

I would like Student's 1, 2, and 3's score for Exam #1 to be plotted on the Stacked Area Chart.