Forum Discussion
List string values in a matrix depending on different permutation
Hi all
Screenshot of the sample source data:
Sanitised sample data in usable format:
| UserID | Day | DiscountedHandset | FreeTrariff | Phone | HasOrdered | Quantity | Sale |
| 1 | 1 | Y | Y | Samsung | N | 0 | 0 |
| 2 | 1 | Y | N | Apple | N | 2 | 4566 |
| 3 | 1 | N | N | Samsung | N | 0 | 0 |
I have a matrix made as below
Screenshot:
Sanitised sample data in usable format:
| UserID | 1 | 2 | 3 | 4 | 5 |
| 1 | Samsung | Samsung | Nokia | Nokia | Samsung |
| 2 | Apple | Apple | Pixel | Pixel | Samsung |
| 3 | Samsung | Pixel | Nokia | Apple | Nokia |
| 4 | Nokia | Nokia | Pixel | Pixel | Samsung |
| 5 | Pixel | Apple | Apple | Pixel | Apple |
| 6 | Samsung | Pixel | Apple | Samsung | Nokia |
| 7 | Apple | Nokia | Apple | Apple | Pixel |
| 8 | Nokia | Apple | Pixel | Nokia | Nokia |
| 9 | Samsung | Apple | Apple | Apple | Nokia |
| 10 | Pixel | Apple | Samsung | Apple | Apple |
The Days are across and Rows have UserID and Values are names of Phones:
I need a second table that displays the list of times a phone changed from one day to the next day by each user.
Additionally also need the number of times users have made each kind of change.
The comparison is only against the previous day.
The output I am after is (please note the table below is not complete):
Screenshot:
Sanitised sample data in usable format:
| From | Changed To | In Day | How many users |
| Samsung | Nokia | 3 | 1 |
| Nokia | Samsung | 5 | 1 |
| Apple | Pixel | 3 | 2 |
| Pixel | Samsung | 5 | 2 |
| Samsung | Pixel | 2 | 2 |
| Nokia | Apple | 4 | 1 |
| Apple | Nokia | 5 | 2 |
| Nokia | Pixel | 3 | 1 |
The model looks like the below:
You can find the file in the link below:
Many thanks in advace.
13 Replies
- Greg_DecklerCommunity Champion
TopHat I fail to understand your numbers. For the first row in your table you have Samsung to Nokia day 3 and you have 3 users but only one switched on day 3 from Samsung to Nokia. So...
- TopHatFrequent Visitor
Apologies I have left the "How many users" column with dummy data but I have now correct it and it now contains real output data.
- lbendlinSuper User
Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to work with. Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523