Forum Discussion
Noak
8 years agoHelper IV
Calculate table
Hey guys I need your help,
I have the following sample data:
| SubscriberID | Category | AccountID | VNumber | Installdate | 48 | 22 | 4 | 2 |
| 1078173 | 22 | 15236 | 11611401 | 12/1/2017 0:00 | 0 | 1 | 0 | 0 |
| 1078620 | 22 | 15236 | 11621901 | 12/6/2017 0:00 | 0 | 1 | 0 | 0 |
| 1078622 | 22 | 15236 | 11621701 | 12/6/2017 0:00 | 0 | 1 | 0 | 0 |
| 1078629 | 22 | 15236 | 11620901 | 12/6/2017 0:00 | 0 | 1 | 0 | 0 |
| 1078630 | 22 | 15236 | 11623801 | 12/6/2017 0:00 | 0 | 1 | 0 | 0 |
| 1078631 | 22 | 15236 | 11611601 | 12/6/2017 0:00 | 0 | 1 | 0 | 0 |
| 1078637 | 4 | 15236 | 11621201 | 12/6/2017 0:00 | 0 | 0 | 1 | 0 |
| 1078638 | 4 | 15236 | 11621601 | 12/6/2017 0:00 | 0 | 0 | 1 | 0 |
| 1078640 | 48 | 15236 | 11602601 | 12/7/2017 0:00 | 1 | 0 | 0 | 0 |
| 1078648 | 22 | 15236 | 11621401 | 12/7/2017 0:00 | 0 | 1 | 0 | 0 |
(for one vnumber we can have several category types)
I would like to have finall result table with the following columns:
Vnumbe | category22 | category48 | category4 | if(category22=1 && category48=1 && category4=1 , Important, Regular)
any tips.tricks?...
Hi Noak,
If I understand you correctly, the formula below should work in your scenario. :smileyhappy:
Table = ADDCOLUMNS ( SUMMARIZE ( Table1, Table1[VNumber], "22", COUNTROWS ( FILTER ( Table1, Table1[Category] = 22 ) ) + 0, "48", COUNTROWS ( FILTER ( Table1, Table1[Category] = 48 ) ) + 0, "4", COUNTROWS ( FILTER ( Table1, Table1[Category] = 4 ) ) + 0 ), "Type", IF ( [22] = 1 && [48] = 1 && [4] = 1, " Important", "Regular" ) )Regards
1 Reply
- v-ljerr-msftMicrosoft Employee
Hi Noak,
If I understand you correctly, the formula below should work in your scenario. :smileyhappy:
Table = ADDCOLUMNS ( SUMMARIZE ( Table1, Table1[VNumber], "22", COUNTROWS ( FILTER ( Table1, Table1[Category] = 22 ) ) + 0, "48", COUNTROWS ( FILTER ( Table1, Table1[Category] = 48 ) ) + 0, "4", COUNTROWS ( FILTER ( Table1, Table1[Category] = 4 ) ) + 0 ), "Type", IF ( [22] = 1 && [48] = 1 && [4] = 1, " Important", "Regular" ) )Regards