Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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
Thanks for your help 🙂
Solved! Go to Solution.
@Anonymous Then try this Measure, also attached an example file
Measure =
CALCULATE( SUM('Table'[Value]), 'Table'[BRAND] in {"A","B"} , ALLEXCEPT('Table','Table'[Product]))
Thanks for your help
But i expressed my problem badly
I need it for every products but A and B aren't the only products :
@Anonymous Then try this Measure, also attached an example file
Measure =
CALCULATE( SUM('Table'[Value]), 'Table'[BRAND] in {"A","B"} , ALLEXCEPT('Table','Table'[Product]))
It's perfect ! thanks for this solution
@Anonymous How many products do you have in the table?
Hi @Anonymous 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)
User | Count |
---|---|
85 | |
79 | |
64 | |
52 | |
46 |
User | Count |
---|---|
101 | |
44 | |
41 | |
39 | |
37 |