Forum Discussion
Calculation sumX multiplication
- 4 years ago
Hi Anonymous
Here is a sample file with the solution https://www.dropbox.com/t/obELBigMGJIPqhHdActually I have tried the same solutions and they seem to work. The thing is it won't allow me to create the hierarchy slicer with pop-up a message saying that the relationship should be One - Many. I don't know how did you create it but arbitrarily shaped slicers usually causes trouble. Using them would require the use of KEEPFILTERS. Unfortunately I failed to simulated your case but you can refer to (2) When to use KEEPFILTERS over iterators - YouTube
Following two workable solutions but using normal slicers.
Anonymous
Ok. Then please try
Measure1 =
SUMX ( Table1, Table1[A] * Table1[B] * SUM ( Table2[C] ) )it gives the same value as the previous one
- tamerj14 years agoCommunity Champion
Anonymous
Measure1 = SUMX ( Table1, Table1[A] * Table1[B] * CALCULATE ( SUM ( Table2[C] ) ) ) - Anonymous4 years agoNot applicable
same value as the previous one too 😭
- tamerj14 years agoCommunity Champion
Anonymous
Yes because there are two values related to each row. I need to have a look at the data structure. Can we connect via zoom or teams? Please share a link in a private message
- Anonymous4 years agoNot applicable
Hello Again,
Sorry i didn't get back to you but the file is confidential. i prepared the tables below to better show the problem.But as seen in the photo above, i'm getting good results for each row alone. but for the total (Sum of the rows) the calculation is being perfomed in another way ( it's not simply making the sum of the calculation rows but it's it's making the sum of each column and then multiplying the results if using the measure sumx(A)*SumX(B)*sumx(C))
orif using the measure sumx(A)*sumx(B*C), it's giving a correct result for each row alone too but for the total it's giving a value of the sum of all the values of column A multiplied by the sum of the multiplication of each row in column B and C
Note: column A is in a different table than columns B and C
i would really appreciate your help in solving this issue - tamerj14 years agoCommunity Champion
Hi Anonymous
Please trySUMX (
VALUES ( Nom ),
CALCULATE ( SUMX ( A ) * SUMX ( B * C ) )
) - Anonymous4 years agoNot applicable
it gives the same value as this one sumx(A)*sumx(B*C)
To explain more on the relationships i have:
i have 2 tables (one as database (containes the type, properties, B, C) and the other as entered data (containes Type, Nom, A))
the relationship is between Type and Type in both tables, and it's a double relationship relating many-to-many.So on power Bi I will choose to associate BB to Yellow and GB2 to blue (as an example, or i can associate to any other properties(color)) and the calculation should perform the multiplication of the values of BB in column A with the corresponding values of Yellow in columns B and C