cancel
Showing results for
Did you mean:
Prashasti Frequent Visitor

## Median of a column in Table Visualization

Hello,

I have table which has iteration and points covered in each iteration as shown below. I need to group the table as shown in figure 2. The second table contains distinct iterations and total points covered in that iteration. Is there a way to calculate the median of these total points covered in Power BI? I need to use the median for further calculation.

Thanks,

Prashasti 2 ACCEPTED SOLUTIONS

Accepted Solutions
LivioLanzo Super Contributor

## Re: Median of a column in Table Visualization

you van calculate the median like this:

```=
MEDIANX (
SUMMARIZE ( Data, Data[Iteration] ),
"Total Points", 1.0 * CALCULATE ( SUM ( Data[Points] ) )
),
[Total Points]
)```

Did I answer your question correctly? Mark my answer as a solution!

Proud to be a Datanaut! v-cherch-msft Super Contributor

## Re: Median of a column in Table Visualization

You may try with below measure.

```Media =
MEDIANX (
SUMMARIZE ( Data, Data[Iteration] ),
CALCULATE ( SUM ( Data[Points] ) )
)
```
```Percent =
DIVIDE ( SUM ( Data[Points] ), CALCULATE ( [Media], ALL ( Data ) ) )
``` Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
5 REPLIES 5
LivioLanzo Super Contributor

## Re: Median of a column in Table Visualization

you van calculate the median like this:

```=
MEDIANX (
SUMMARIZE ( Data, Data[Iteration] ),
"Total Points", 1.0 * CALCULATE ( SUM ( Data[Points] ) )
),
[Total Points]
)```

Did I answer your question correctly? Mark my answer as a solution!

Proud to be a Datanaut! Prashasti Frequent Visitor

## Re: Median of a column in Table Visualization

Thanks @LivioLanzo, It worked.. I had another doubt. Is it possible to divide the total points of each iteration by the median calculated in this measure? ( In this case 32/38) I need this to calculate the percentage for iteration.

TIA.

v-cherch-msft Super Contributor

## Re: Median of a column in Table Visualization

You may try with below measure.

```Media =
MEDIANX (
SUMMARIZE ( Data, Data[Iteration] ),
CALCULATE ( SUM ( Data[Points] ) )
)
```
```Percent =
DIVIDE ( SUM ( Data[Points] ), CALCULATE ( [Media], ALL ( Data ) ) )
``` Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Prashasti Frequent Visitor

## Re: Median of a column in Table Visualization

Thank you @v-cherch-msft , the measure worked perfectly.

Prashasti Frequent Visitor

## Re: Median of a column in Table Visualization

Hey @v-cherch-msft,

In my actual table there are many iterations and I need to display the top 6 iterations and get the score for them. I modified your percent solution to use AllSelected() instead of All() as suggested by you. However, in my graph visualization(Custom Column Chart), upon selecting a particular iteration,the value of percent changes to 1 for all iterations.

Hoping you could help out here.

Thanks,

Prashasti  Announcements #### Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform. #### Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work Top Kudoed Authors
Users Online
Currently online: 6 members 3,086 guests
Recent signins:
• mrJsy- • geirf • Matt_Mcmillin • Sergii24 • vjnvinod • joseph_kanish • Chesta96 • sladonia • idajh • mihirkanani • nkruszanski • nataliads • AksAnt 