Forum Discussion
dividing two measures
Hello
this is my data
| Id | BrandM1 | BrandM2 | Wave |
| 1 | A | D | w3 |
| 2 | B | D | w2 |
| 3 | C | D | w2 |
| 4 | D | C | w2 |
| 5 | A | A | w1 |
| 6 | B | B | w2 |
| 7 | C | D | w3 |
| 8 | A | C | w3 |
| 9 | B | D | w2 |
| 10 | C | D | w3 |
| 11 | D | D | w3 |
| 12 | D | C | w1 |
| 13 | D | A | w3 |
| 14 | C | B | w1 |
| 15 | A | D | w2 |
| 16 | B | C | w2 |
| 17 | D | C | w3 |
| 18 | C | A | w3 |
| 19 | A | B | w1 |
i want to calculate the percentage of column total of BrandM1 and BrandM2:
| Row Labels | w1 | w2 | w3 | Grand Total |
| A | 50,00% | 14,29% | 25,00% | 26,32% |
| B | 0,00% | 57,14% | 0,00% | 21,05% |
| C | 25,00% | 14,29% | 37,50% | 26,32% |
| D | 25,00% | 14,29% | 37,50% | 26,32% |
| Grand Total | 100,00% | 100,00% | 100,00% | 100,00% |
| Row Labels | w1 | w2 | w3 | Grand Total |
| A | 25,00% | 0,00% | 25,00% | 15,79% |
| B | 50,00% | 14,29% | 0,00% | 15,79% |
| C | 25,00% | 28,57% | 25,00% | 26,32% |
| D | 0,00% | 57,14% | 50,00% | 42,11% |
| Grand Total | 100,00% | 100,00% | 100,00% | 100,00% |
then i want to divide them (table1/table2)
| Brands | w1 | w2 | w3 |
| A | 2,00 | #DIV/0! | 1,00 |
| B | 0,00 | 4,00 | #DIV/0! |
| C | 1,00 | 0,50 | 1,50 |
| D | #DIV/0! | 0,25 | 0,75 |
3 Replies
- amitchandak
Super User
Khaoula_Farissi , You can have measures like
M1 = divide(countrows(Table),calculate(countrows(Table), allexpect(Table, Table[wave])))
M2 = divide(countrows(Table),calculate(countrows(Table), allexpect(Table, Table[BrandM1])))
M3 = divide(countrows(Table),calculate(countrows(Table), allexpect(Table, Table[BrandM2])))
last table
measure 1 =
var M1 = divide(countrows(Table),calculate(countrows(Table), allexpect(Table, Table[wave])))
var M2 = divide(countrows(Table),calculate(countrows(Table), allexpect(Table, Table[BrandM1])))
return
divide(M1,M2) - Khaoula_FarissiFrequent Visitor
- amitchandak
Super User
Khaoula_Farissi , You want to use M1 and M2 in same row, that is bit different. I create a file, Check that. You need check you second martix is grouping M2 or Using M2 in formula but grouping M1, based on that you have to change formula.
Please find the file attached after signature.