cancel
Showing results for
Did you mean:
Member

## Total value for all rows

Hello,

I have this matrix visualization with 2 measures:

 AREA Concepte FACT Cost Fact TempCOST TempFACT Area1 1.437,25 2.880,19 1.437,25 2.880,19 AM 25,00 1.437,25 EC 20,00 1.437,25 JS 1.160,00 1.437,25 MP 35,00 1.437,25 MR 137,00 1.437,25 RC 60,00 1.437,25 LA01 2.778,19 2.880,19 LA02 102,00 2.880,19 Area2 435,00 0,00 435,00 0,00 AM 375,00 0,00 435,00 0,00 JP 60,00 0,00 435,00 0,00

where TempCOST = CALCULATE(SUM(Table1[Cost]);ALL(Table1[Concepte FAC])) and TempFACT = CALCULATE(SUM(Table1[Fact]);ALL(Table1[Concepte FAC])).

I need this result in the table:

 AREA Concepte FACT Cost Fact TempCOST TempFACT Area1 1.437,25 2.880,19 1.437,25 2.880,19 AM 25,00 1.437,25 2.880,19 EC 20,00 1.437,25 2.880,19 JS 1.160,00 1.437,25 2.880,19 MP 35,00 1.437,25 2.880,19 MR 137,00 1.437,25 2.880,19 RC 60,00 1.437,25 2.880,19 LA01 2.778,19 1.437,25 2.880,19 LA02 102,00 1.437,25 2.880,19 Area2 435,00 0,00 435,00 0,00 AM 375,00 0,00 435,00 0,00 JP 60,00 0,00 435,00 0,00

Which are the correct formula to the both measures?

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Member

## Re: Total value for all rows

I've found the solution!!!

The formula for the measure is:

TempCOST = CALCULATE(SUM(Table1[Cost]);ALLSELECTED(Table1);VALUES(Table1[Area]))

Thank you @v-yuezhe-msft@Pavlous and @Floriankx for your help.

Bye!!

18 REPLIES 18
Established Member

## Re: Total value for all rows

Hello,

can you show us the structure of your raw data?

I created this RawTable:

 Area Concepte FACT Cost Fact Area1 AM 25,00 Area1 EC 20,00 Area1 JS 1.160,00 Area1 MP 35,00 Area1 MR 137,00 Area1 RC 60,00 Area1 LA01 2.778,19 Area1 LA02 102,00 Area2 AM 375 0 Area2 JP 60 0

I created the following Measures:

Cost_:=SUM(Table1[Cost])

TemCOST:=CALCULATE([Cost_];ALL(Table1[Concepte FACT]))

Fact_:=SUM(Table1[Fact])

TempFACT:=CALCULATE([Fact_];ALL(Table1[Concepte FACT]))

And this is my result:

Member

## Re: Total value for all rows

This is the relationship between tables in the data model:

Thank you!

Established Member

## Re: Total value for all rows

Hello,

relationship doesn't seem to be the problem, as long as CodArea columns are related properly and CodArea is unique in your AREAS Table.

It still should work.

You can try to use CodArea of Table1 instead of Area of the AREAS Table and see if something changes.

Best regards.

Member

## Re: Total value for all rows

Hello,

I tried your response but the result is the same. What I can do?

Thanks.

Established Member

Best regards

Highlighted
Member

## Re: Total value for all rows

Here you are:

 DATE CODAREA COL CONCEPTE COST FACT CONCEPTE FAC 11/05/2017 A1 AM 10,00 AM 24/06/2017 A1 EC 5,00 EC 05/07/2017 A2 AM 12,00 AM 06/07/2017 A3 JS 11,00 JS 01/01/2017 A1 MP 25,00 MP 28/02/2017 A2 MR 13,00 MR 15/03/2017 A1 LA01 200,00 LA01 20/08/2017 A1 RC 14,00 RC 11/05/2017 A2 MP 25,00 MP 11/04/2017 A2 EC 32,00 EC 10/02/2017 A3 AM 44,00 AM 04/01/2017 A3 LA01 360,00 LA01 31/03/2017 A1 LA02 175,00 LA02 20/06/2017 A2 JS 27,00 JS

And the Areas table:

 CODAREA AREA A1 Area1 A2 Area2 A3 Area3

Thank you.

Regular Visitor

## Re: Total value for all rows

Hi,

it would be heplfull if you show us what is your result at that moment. So we can think what you are doing wrong

Member

## Re: Total value for all rows

Hi,

This is the result:

And this are the measures:

TempCOST = CALCULATE(SUM(Table1[Cost]);ALL(Table1[Concepte FAC]))

TempFACT = CALCULATE(SUM(Table1[Fact]);ALL(Table1[Concepte FAC]))

Regards.

Established Member

## Re: Total value for all rows

Hello, I guess CONCEPTE FAC is a calculated column.

If it is any if statement maybe try

Best regards

Announcements

#### Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

#### Community News & Announcements

Get your latest community news and 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.

#### Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Top Kudoed Authors
Users Online
Currently online: 47 members 944 guests
Recent signins: