Hello Armani Hammer,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that you are unable to Add Duplicate Values in Table Column for Profit and Loss Statement in Azure AI Document Intelligence.
To reduce overhead, you can resolve the issue by the following steps:
Step 1:
- Label Tables Explicitly:
- Treat each row as a separate entry, even if the "Account" value repeats.
- Label all cells in every row (including duplicates like "Total Income") during model training. Do not rely on implicit inheritance from previous rows.
- Map Column Headers to Rows: if dates are column headers (e.g., "June 2023"), label them as headers. Azure will associate values under each date column with the correct header.
Step 2:
Specify tables in the features parameter to extract structured table data:
POST https://{endpoint}/documentintelligence/documentModels/prebuilt-layout:analyze?api-version=2024-02-29-preview
{
"features": ["tables"]
}
Step 3:
If the raw JSON output skips duplicates, write a script to fill gaps using the last non-empty value for Account:
# Example Python script to handle duplicate "Account" values
current_account = ""
for row in extracted_table_rows:
if row["Account"] != "":
current_account = row["Account"]
else:
row["Account"] = current_account
NOTE: This is Post-Processing (If Needed).
Step 4:
Ensure the final JSON includes all values explicitlylike an example below:
{
"tables": [
{
"rows": [
{
"cells": [
{ "content": "June 2023", "role": "columnHeader" },
{ "content": "Total Income", "role": "rowHeader" },
{ "content": "1,234,567$" }
]
},
{
"cells": [
{ "content": "July 2023", "role": "columnHeader" },
{ "content": "Total Income", "role": "rowHeader" },
{ "content": "1,432,765$" }
]
}
]
}
]
}
In summary for the account document:
- Use Document Intelligence Studio to label tables with duplicates explicitly.
- Avoid queryFields for tabular data; use table extraction instead.
- Fill gaps programmatically if Azure skips duplicates.
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.