cancel
Showing results for
Did you mean:
Highlighted
Frequent Visitor

## The measure named "expected" shows different number in totals used in table and pie chart visual

I would like to start my problem description with providing my example file: Rekenmodel_0008_-_test_-_002_-_PBI.pbix

In the following screenshot I would like to point out the issues:

Screenshot

I would like to ask you to observe the column expected. Here you will notice 3 rows.

The first point I want to make:

when you add the values of the 3 rows it will add up to: 17 and the column total says: 8

So my first question is why doesn't the total of the column: "expected" say 17?

And how can I make the table show a total of 17 in the column: "expected"?

The second point I want to make:

As you look at the pie chart the black tooltip shows that the value for "expected" is: 20

To me it would have made sense it would also be the total of the visual rows in this case: 17

So why doesn't the black tooltip say 17 (or even 8 as it seems to be the column total here)?

And how can I make the black tooltip show the value of 17 as the value of "expected"?

I will be thankful for anyone who can provide hints or tips and of course the help on how to solve this!

2 REPLIES 2
Community Support Team

## Re: The measure named "expected" shows different number in totals used in table and pie ch

Hi Martijn2019,

As I know, the measure is not fixed, it will calculated based on current visual context, so your matrix total is incorrect, if you want to get correct value you could try to use below measure

```Expected = var  temp=
IF(
CONTAINS(Rules, Rules[Interval],"X: 3 months / Y: 12 years / Z: 4 years"), ROUNDUP( COUNT(Equipment[ID])*4 ,0) ,
IF(
CONTAINS(Rules, Rules[Interval],"12 years"), ROUNDUP( COUNT(Equipment[ID])/12 ,0) ,
IF(
CONTAINS(Equipment,Equipment[class],"A:"), ROUNDUP( COUNT(Equipment[ID])*12 ,0) ,
IF(
CONTAINS(Equipment,Equipment[class],"C:"), ROUNDUP( COUNT(Equipment[ID])*2 ,0) ,
COUNT(Equipment[ID])
)
)))  return  sumx(SUMMARIZE(Equipment,Equipment[ID],"a",temp), [a])```

Or  you could try to create calculate column which won’t be based on visual context.

And this will affect the result of pie chart, so I think you need to consider more about the calculation logic

Best Regards,

Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Frequent Visitor

## Re: The measure named "expected" shows different number in totals used in table and pie ch

First of all thank you very much for your time and effort to look into this with me!

I found it very interesting to see how you added the variable and used the return component of the expected measure.

But it is just that even now the column should add up to 17 not 16! Even with your new definition of the measure we are still missing 1. And the value of expected in the black tooltip (when you hover the pie chart) now indicates 100 instead of the 20 it did before.

Perhaps we can look into this a little more?

Announcements

#### Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

#### Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

#### Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!