Forum Discussion
Assigned to Previous column
sivasrao , I cannot quite figure out the PowerBI way right now, but I can figure that out using Excel formula.
The following are the data I mimicked using MS Excel.
The forumlas are as below:
| A | |
| B | =AND(A2="R",A3="R") |
| C | =IF(AND(A2="R",A3<>"R"),TRUE,FALSE) |
| D | =IF(OR(B2=TRUE,C2=TRUE),1,0) |
| E | =IF(AND(B2=FALSE,C2=FALSE,OR(AND(B3=TRUE,C3=FALSE),AND(B3=FALSE,C3=TRUE))),SUM(D2:INDIRECT("D"&MATCH(TRUE,C2:C$1048576,0)+ROW(D2)-1)),0) |
Just prepare your column A in Excel format, with the headers in row 1. Paste the formulas in B1 to E1 and then drag then down to your end of the data.
Finally, load column A and column E in the PowerBI.
By using =IF(A2="C",0,1) we can get the D column.
Can you please suggest a logic if we have only two columns like C, R in one column and O,1 in another column.
See the below table,
| Event | Binary Help |
| C | 0 |
| C | 0 |
| C | 0 |
| R | 1 |
| R | 1 |
| R | 1 |
| C | 0 |
| C | 0 |
| R | 1 |
| R | 1 |
- johnyip3 years agoSolution Sage
In this case, just merge the logic and B2 and C2 into E2. This will make the formula hard to read though, although it will create fewer columns.
And yes, you can get column D as easy as that, my mind's screwed up when dealing with the logics.
- sivasrao3 years agoHelper III
If we have only two columns as I mentioned in the above reply,then what logic we can put to get the Target Column.
Please give that logic.