GSTDOST
Edit
SUPPORT & DOWNLOAD

We provide holistic services for Businesses served with a GST DOST to help them ward for all kinds of issues and prevent litigations.

HEAD OFFICE
FOLLOW US
Power Query Can Multiply Your ITC: Test the Merge Before Trusting the Reconciliation
 
En-English
 

The purchase register is correct. The file downloaded from the GST portal is correct. The two are merged in Power Query, and the result shows input tax credit that is double the real figure on both sides. Nothing was wrong with the data. The merge itself created rows that never existed. Because both sides grew by the same amount, the reconciliation shows no difference and is signed off.

In simple terms

  • When one invoice has more than one row in each file, a merge on the invoice number pairs every row on one side with every row on the other.
  • Two rows against two rows become four. Any total taken after that is overstated.
  • The cure is to check how many rows each key has before merging, and to bring both files to one row per document.

Why this matters

An invoice with three items appears as three lines in the books. The same invoice can appear as more than one row in a portal download, for example where its items carry different tax rates. Matching by invoice number feels natural, and for most invoices it works. The few that have several rows on both sides distort the totals without any error message. In the annual return season this reaches the comparison of credit in the books with GSTR-2B and with Table 8A of GSTR-9.

How the multiplication happens

Microsoft's documentation describes a merge in two steps. First, Power Query adds a new column to the left table. Each cell of that column holds a small table containing all the rows of the right table that match that row. Second, you expand that column to bring the right table's fields into view. If the small table has two rows, expanding it turns one row of the left table into two.

Practical example

Purchase invoice P-101 has two lines in the books and two rows in the portal file. Each file is correct, and each shows GST of ₹1,800 on this invoice.

File Row GST
Books P-101, line 1 600
Books P-101, line 2 1,200
Portal file P-101, row A 600
Portal file P-101, row B 1,200

After a merge on the invoice number, followed by an expand, the result has four rows.

Books row Books GST Portal row Portal GST
Line 1 600 Row A 600
Line 1 600 Row B 1,200
Line 2 1,200 Row A 600
Line 2 1,200 Row B 1,200
Total 3,600   3,600

Illustrative figures only, in rupees.

Both totals read ₹3,600 and the difference is nil. Both are overstated by ₹1,800. This is an error of data handling. It does not show that the business took excess credit.

The damage is not always equal on both sides. Suppose the books have the same two lines, but the portal file has a single row of ₹1,800. After the merge and expand, the books side still adds up to ₹1,800, but the portal row appears twice and adds up to ₹3,600. The working now shows ₹1,800 of credit as available on the portal and not taken in the books. That difference is not real.

Testing the merge, step by step

  1. Write down the totals first. For each file, note the number of rows, the number of documents and the tax under each head. Every later step is checked against these.
  2. Build the same key on both sides. Use the recipient's GSTIN, the supplier's GSTIN, the document type, the financial year and the original document number. Set these columns to text in both tables. Microsoft's guide says that the columns paired in a merge must have the same data type and must be selected in the same order in both tables.
  3. Count the rows for each key. In each table, use Group By on the key with Count Rows. Any key with a count above one has more than one row.
  4. Find out why. Several rows may be genuine lines of one document, or the same document imported twice. Do not delete anything until you know which.
  5. Bring both tables to one row per document. Where the rows are genuine lines and the aim is to compare documents, use Group By on the key and total each tax head. Keep the detailed table as a separate query for later reference.
  6. Merge, and count the matches before expanding. Rename the new column Matches and add a custom column with the formula below. Zero means no match. One is what you expect. Anything above one needs a look before you go on.
  7. Expand, and prove the totals. The tax totals after the merge must equal the totals written down in the first step. In a left outer merge with one row per key on the right, the number of rows must equal the number of rows in the left table.
Table.RowCount([Matches])

Keep original documents, amendments and credit notes apart while doing this, so that a credit note is not matched to an invoice with a similar number.

What the tool cannot do: Power Query does exactly what it is told. It cannot tell whether two rows are lines of one invoice or the same invoice entered twice, or whether the credit was in fact claimed in a return. A person has to settle those. Do not upload company or client records to a public AI tool without permission and proper safeguards. Test your steps on made-up data.

Where this fits in the annual return

GSTN provides document-level details behind Table 8A of GSTR-9 as a download. These are useful for comparing the credit in the books, invoice by invoice. They do not prove that a credit is eligible or that it was claimed. And a comparison is only as good as the merge behind it. The test described here is a voluntary check on the quality of the working. It is not a requirement of GST law.

Action points

If you own or manage the business

  1. Ask for the totals before and after. A reconciliation should show the source totals and confirm that they survived the processing.
  2. Be wary of a perfect match. Two totals that agree may both be wrong by the same amount.
  3. Ask whether a large difference is real. Before acting on credit shown as missed or excess, ask whether duplicate rows were ruled out.
  4. Have the method written down. The key, the steps and the checks should be the same every month, whoever does the work.

If you do or review the reconciliation

  1. Record the row count, document count and tax-head totals of each source file.
  2. Test whether the key is unique on each side before merging.
  3. Count the matches in the merged column, and set aside rows with no match and rows with more than one.
  4. Total genuine lines to the level at which you mean to compare, then run the merge again.
  5. Check the totals, the unmatched rows and the actual claim in the returns before signing off.

Red flag: The GST totals go up after a merge is expanded, and the reconciliation is approved because the two sides agree.

Records to keep: The original files, the definition of the key, the query steps, the totals before and after, the list of exceptions and the conclusion on each.

What you should have at the end: A reconciliation whose totals agree with the source files, with one row for each document and a short list of real differences to follow up.

Practical takeaway

Before relying on a merge, check what one row stands for in each table, and check that the totals did not change.

Terms used in this article

Power Query
The tool in Excel, under the Data tab, for importing, cleaning and combining data in recorded steps.
Merge
Joining two tables on one or more matching columns.
Key
The column, or combination of columns, used to match rows between two tables.
Expand
The step that brings the matched rows of the second table into the first as ordinary columns and rows.
Left outer merge
A merge that keeps every row of the first table and adds matching rows from the second.
Group By
A step that puts rows with the same key into one group and counts or totals them.
Table 8A of GSTR-9
The row of the annual return that shows the credit made available to the business on the GST portal.

Sources and references

Disclaimer: This article is for general information only and reflects the position as understood on the review date mentioned above. It is not legal advice and does not create a professional relationship. The steps describe a method of checking data. They do not decide whether any credit is eligible or was correctly claimed. Menu names can differ between versions of Excel. Figures in the example are illustrative. Please obtain professional advice before acting on this article.

GST DOST | GST Annual Return, Reconciliation and Technology-led Review

Vikash Dhanania

Founder of GST DOST, is a seasoned CA with exceptional expertise in GST. Honored with the prestigious Hariyana Pratibha Puruskaar, Vikash is known in the market as DOST, reflecting his friendly and supportive approach. He excels in leveraging AI, KI, and EI to deliver impactful solutions that satisfy clients. An accomplished author, prolific blogger, and creator of educational videos for the business community, he also launched the groundbreaking online GST talk show, "GST ki Baat Dost ke Saath."