User |
Location |

AAA | Tokyo |

AAA | Osaka |

AAA | Nagoya |

AAA | Hakone |

AAA | Kyoto |

BBB | Sapporo |

BBB | Nara |

CCC | Tokyo |

CCC | Hakone |

CCC | Osaka |

DDD | Osaka |

DDD | Tokyo |

Customer AAA travelled from Tokyo to Osaka, Osaka to Nagoya, Nagoya to Hakone and Hakone to Kyoto. All locations appear in a single column. To analyse customer travel information very clearly, one may want to rearrange the dataset as follows:

User |
From |
To |

AAA | TOKYO | OSAKA |

AAA | OSAKA | NAGOYA |

AAA | NAGOYA | HAKONE |

AAA | HAKONE | KYOTO |

BBB | SAPPORO | NARA |

CCC | TOKYO | HAKONE |

CCC | HAKONE | OSAKA |

DDD | OSAKA | TOKYO |

I have solved this problem using Power Query. You may download my solution workbook from here.

]]>On this small sample, one may want to identify "Cross and up selling opportunities" i.e. one may want to know which are the Customers that can be approached for selling more products to. So for e.g. one may want to know which Customers have bought only one product so far. A case in point being the Apple Watch - Customer ID 2442 and 428 bought only this product. The other Customers who bought the Apple Watch also bought atleast one more product. Therefore, Cust ID 2442 and 428 could be approached for buying other products as well.

Solving this via conventional Excel formulas and Pivot Tables would prove to be a formidable challenge. I have solved this problem using a Data visualisation software from Microsoft called PowerBI desktop (it can be downloaded free from the Microsoft website). This problem can also be solved in MS Excel using Power Query and Power Pivot.

There are 3 sections in the image below - Table at the top (First Table), slicers at the right and another Table at the bottom (Second Table).

**Interpretation of First Table**

- 1 appearing at the intersection of APPLE TV (row labels) and APPLE TV (column labels) represents that there is 1 customer who bought the APPLE TV
- 1 appeaing at the intersection of APPLE TV (row labels) and MACBOOK AIR (column labels) represents that the 1 customer who bought the APPLE TV also bought the MACBOOK AIR

- 4 appearing at the intersection of APPLE WATCH (row labels) and APPLE WATCH (column labels) represents that there are 4 customers who bought the APPLE WATCH
- 1 appearing in other columns of the same row represents other products which those customers bought
- When one right click's on APPLE WATCH and selects "Drill down", one will be able to see the Customers who bought the other products as well.
- Customer 53 bought the APPLE WATCH, AIRPORT and IPHONE 8S. Customer 123 bought APPLE WATCH, IPHONE X and IPOD
- Customers 2442 and 428 did not buy any other product

**Interpretation of Second Table**

This table shows a list of Customers (and their transaction details) who bought only and only that one product selected by the user in the filter section (see the red oval selection in the image). So these two customers could be approached for selling more products to.

You may download my PBI desktop file from here.

]]>Via a simple Pivot Table, one can determine the lowest bidding vendor per product (part) for any chosen month. However, one may also want to know the names of those vendors for each product (as seen in column G below). Notice, that Vendor 2 and Vendor 3 submitted the lowest bid for Product 1 and therefore both names should appear in the result.

I have solved this problem using PowerPivot and Power Query a.k.a. Data > Get & Transform in Excel 2016. You may download my solution workbook from here.

]]>The objective is to sort, in ascending order, the entries in each cell. The expected result is shown below.

I have solved this problem using Power Query a.k.a Data > Get & Transform in Excel 2016. You may download my solution workbook from here.

]]>The expected result is:

I have solved this problem using Power Query a.k.a. Data > Get & Transform in Excel 2016. You may download my solution workbook from here.

]]>The objective is to create a simple matrix with months in the row labels, years in the column labels and sales figures in the value area section. The twist in the question is that for years prior to the current year (2018 in this dataset), sales should only appear till the month for which there is data for the current year. For e.g., for 2018, data is only till Month 4 and therefore for prior years as well, data should only appear till Month 4. As and when Sales data gets added below row 17, data for prior years should also go up to that month.

The expected result is

You may download my PBI file from here. The same solution can be obtained in Excel as well (using Power Query and PowerPivot).

]]>The objective is to create two Tables from this single table - one showing the Accounts created within the chosen time period and another showing the those that were closed within the same time period. Here are screenshots of the expected results.

You may download my PowerBI desktop solution workbook from here. The same solution can be obtained in Excel as well (using Power Query and PowerPivot).

]]>For each tier, the tier rate is incrementally applied to the volume within the tier volume range. Given the following transaction volumes, one may want to compute the transaction fee

The expected result is shown below

As one can observe, for a transaction value of 400,000, the fee has been computed as 3% on the first 100,000 and 2.5% on the next 300,000. You may download my solution workbook from here. In the file, I have shared 2 solutions - a conventional formula based one and a PowerPivot solution.

I have also solved a similar question here.

]]>PatientID |
SmokingStatus |
ReviewDate |

P1 | 10-03-2018 | |

P1 | 9 | 09-03-2018 |

P1 | 1 | 08-03-2018 |

P1 | 4 | 07-03-2018 |

P2 | 9 | 10-03-2018 |

P2 | 9 | 09-03-2018 |

P2 | 9 | 08-03-2018 |

P2 | 9 | 07-03-2018 |

P3 | 2 | 10-03-2018 |

P3 | 09-03-2018 | |

P3 | 9 | 08-03-2018 |

P4 | 9 | 10-03-2018 |

P4 | 1 | 09-03-2018 |

P4 | 4 | 08-03-2018 |

The objective is the create another 3 column dataset with the following conditions:

- If the patient's latest smoking status is other than Blank or 9, then consider that as the smoking status of the patient; and
- If the patient's latest smoking status is blank or 9, then consider the previous smoking status that is not blank or 9; and
- If the patient's smoking status is blank or 9 on all dates, then consider the smoking status as 9

The expected result is:

PatientID |
Last date when the smoking status was other than 9 or Blank |
Smoking status on that date |

P1 | 08-Mar-18 | 1 |

P2 | 10-Mar-18 | 9 |

P3 | 10-Mar-18 | 2 |

P4 | 09-Mar-18 | 1 |

I have solved this question using 3 methods - PowerPivot, Advanced Filters and formulas. You may download my solution workbook from here.

]]>Vendor Name |
Item ID# |
Date Received |
Error with Item? |
Error Category |

California | X170016 | 1-16-2017 | No | |

California | X170014 | 1-13-2017 | Yes | Labeling Error |

California | X170015 | 1-13-2017 | Yes | Packaging Error |

California | X170008 | 1-9-2017 | Yes | Quality Issue |

California | X170003 | 1-2-2017 | No | |

California | X160645 | 12-26-2016 | Yes | Packaging Error |

California | X160646 | 12-26-2016 | No | |

California | X160644 | 12-25-2016 | Yes | Labeling Error |

California | X160638 | 12-20-2016 | Yes | Quality Issue |

California | X160633 | 12-15-2016 | No | |

California | X160626 | 12-8-2016 | No | |

California | X160625 | 12-7-2016 | Yes | Packaging Error |

California | X160624 | 12-5-2016 | Yes | Labeling Error |

California | X160618 | 11-23-2016 | Yes | Quality Issue |

California | X160613 | 11-13-2016 | No | |

California | X160606 | 10-30-2016 | No |

The objective is to compute the error rate by vendor and Error category for the **10 most recent transaction dates with that specific vendor**. So, for vendor Name "California" and Error category as "Packing Error", this ratio should be computed as = Number of packing Errors on 10 most recent dates/10.

Here is a simple snapshot of the Data for California. I have filtered the dataset where Vendor Name is California and then sorted the Date received column in descending order. Please note that when i filter the dataset on California, a lot more rows are returned. I am only showing the Top 10 rows here because that is what is important for solving this question.

Vendor Name |
Item ID# |
Date Received |
Error with Item? |
Error Category |

California | X170016 | 1-16-2017 | No | |

California | X170014 | 1-13-2017 | Yes | Labeling Error |

California | X170015 | 1-13-2017 | Yes | Packaging Error |

California | X170008 | 1-9-2017 | Yes | Quality Issue |

California | X170003 | 1-2-2017 | No | |

California | X160645 | 12-26-2016 | Yes | Packaging Error |

California | X160646 | 12-26-2016 | No | |

California | X160644 | 12-25-2016 | Yes | Labeling Error |

California | X160638 | 12-20-2016 | Yes | Quality Issue |

California | X160633 | 12-15-2016 | No |

The expected result is:

Row Labels |
Labeling Error |
Packaging Error |
Quality Issue |
Factory Error |

Boise | 30.00% | |||

California | 20.00% | 20.00% | 20.00% | |

Detroit | 70.00% | 30.00% | ||

Ekalaka | 20.00% | 20.00% |

I have solved this problem using the PowerPivot. You may download my solution workbook from here.

]]>