cancel
Showing results for
Did you mean:
New Member

## Create a new total column per specific row

Hello,

I need some help for summarize row in a new column with a condition on rows

The logic is : Sum for each product the value of BRAND A & BRAND B and put in every row

What i have :

What i want :

Sum of product A BRAND A + product A BRAND B = 15

Sum of product B BRAND A + product B BRAND B = 50

1 ACCEPTED SOLUTION
Super User

@ValentintT Then try this Measure, also attached an example file

``````Measure =
CALCULATE( SUM('Table'[Value]), 'Table'[BRAND] in  {"A","B"} , ALLEXCEPT('Table','Table'[Product]))``````

__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine
5 REPLIES 5
New Member

But i expressed my problem badly
I need it for every products but A and B aren't the only products :

Super User

@ValentintT Then try this Measure, also attached an example file

``````Measure =
CALCULATE( SUM('Table'[Value]), 'Table'[BRAND] in  {"A","B"} , ALLEXCEPT('Table','Table'[Product]))``````

__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine
New Member

It's perfect ! thanks for this solution

Super User

@ValentintT How many products do you have in the table?

__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine
Super User

Hi @ValentintT try it

``````Measure =
VAR BR_a = CALCULATE( SUM('Table'[Value]), 'Table'[BRAND] = "A" &&  'Table'[Product] = "A") + CALCULATE( SUM('Table'[Value]), 'Table'[BRAND] = "B" &&  'Table'[Product] = "A")
VAR BR_b = CALCULATE( SUM('Table'[Value]), 'Table'[BRAND] = "A" &&  'Table'[Product] = "B") + CALCULATE( SUM('Table'[Value]), 'Table'[BRAND] = "B" &&  'Table'[Product] = "B")
return
IF( SELECTEDVALUE('Table'[Product]) = "A", BR_a ,BR_b)``````

__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

Announcements

#### 2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

#### Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

#### 2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors