Build a Business Analytics Dashboard
What you'll learn
~30 min- Direct an AI to build a complete business analytics dashboard from a single prompt
- Understand how CSV parsing, KPI computation, and chart rendering work together
- Customize a generated tool with follow-up prompts to match business requirements
- Apply the ETL pattern (Extract, Transform, Load) in a hands-on context
What you’re building
Every MIS course asks you to analyze data. Every time, you fire up Tableau, wait for the license server, fight with data connections, and spend 40 minutes building something that should take 5. What if you could drag a CSV file into a browser window and have KPI cards, bar charts, line charts, scatter plots, and a sortable data table appear instantly?
That is what you will build in this lesson — in about 10-20 minutes for first-time users, or 3-5 minutes once your setup is ready.
This module isn’t just coursework — it’s portfolio material. By the end, you’ll have built a working analytics dashboard that demonstrates exactly what “AI-augmented business analyst” looks like. This is the artifact you show during your next review or interview. It proves you can combine business acumen with modern tooling to produce real results, fast.
By the end you will have a single HTML file that works as a complete business analytics dashboard. Drop most well-formed CSVs onto it (UTF-8 recommended, under 50 MB for smooth browser performance), and it auto-detects columns, computes summary KPIs, and renders interactive Chart.js visualizations. No server. No license. No installation. Open it on any computer with a browser and it works.
Import → clean → aggregate → chart. This pattern works for experiment logs, sensor readings, survey results — any tabular data that needs visualization.
🔍Domain Primer: Key business/data terms you'll see in this module
New to business analytics? Here are the key terms you’ll encounter:
- CSV — Comma-Separated Values. A simple text file where each line is a row of data, and commas separate the columns. Think of it as a spreadsheet saved as plain text. You can open CSVs in Excel, Google Sheets, or any text editor.
- KPI (Key Performance Indicator) — A measurable value that shows how well something is performing. Revenue, customer count, and conversion rate are all KPIs. A KPI dashboard shows these numbers at a glance.
Coming in the next lessons: ER Diagrams, database schemas, and SQL — you will learn those terms when you build the Database Schema Designer.
You don’t need to master these concepts — the AI tools will help you build with them. Knowing the vocabulary helps you ask better questions.
Who this is for
- MIS undergrads who need quick data exploration before a deeper analysis.
- Business analytics students building portfolio pieces or class presentations.
- Anyone tired of waiting for Tableau to load when they just want to see what a dataset looks like.
The showcase
Here is what the finished dashboard looks like once you open the HTML file and upload a CSV:
- File upload area with drag-and-drop support and a file picker button.
- KPI cards across the top showing row count, column count, and auto-calculated summary stats (sum, average, min, max) for the first three numeric columns.
- Column selector panel letting you choose which columns to visualize.
- Chart section with tabs for Bar, Line, Scatter, and Pie charts — pick your X and Y axes from dropdowns and the chart updates live.
- Sortable data table showing all rows with click-to-sort column headers, search/filter box, and pagination (50 rows per page).
- Export buttons for downloading filtered data as CSV and charts as PNG images.
Your CSV data is processed locally in the browser — it is never uploaded to any server. External libraries and fonts are fetched from CDNs on page load. You can email this file to a teammate and they will have the same dashboard on their laptop in seconds.
In standard business intelligence training, you learn to turn raw data into actionable insight using BI tools. This dashboard follows the same principles — data ingestion, transformation, KPI identification, and visualization — but you control every piece. Understanding what BI tools do under the hood makes you a better analyst, and building one yourself is a portfolio piece that shows employers you understand the full stack.
The prompt
Open your terminal, navigate to a project folder, start your AI CLI tool (such as Claude Code, Gemini CLI, or your preferred tool), and paste this prompt:
Build a single self-contained HTML file called analytics-dashboard.html that serves asa business analytics dashboard for CSV data. Requirements:
1. CSV UPLOAD - Drag-and-drop zone (dashed border area) and a "Choose File" button - Parse CSV with PapaParse (load from CDN: https://cdn.jsdelivr.net/npm/papaparse@5) - Auto-detect headers from the first row - Auto-detect column types: numeric (parseable as float), date (ISO or MM/DD/YYYY), or categorical (everything else) - Handle quoted fields, commas inside quotes, and UTF-8 encoding - If characters look broken after upload, note that the CSV should be re-saved as UTF-8 - Show a loading spinner for files over 1 MB
2. KPI CARDS (top of page, appear after upload) - Card 1: Total Rows / Total Columns - Cards 2-4: For the first three numeric columns, show: - Column name as the card title - Sum, Average (2 decimal places), Min, Max - Cards are styled as rounded rectangles with a subtle gradient background - Numbers animate counting up when they first appear
3. COLUMN SELECTOR - Sidebar or top panel listing all columns with checkboxes - Toggle columns on/off for the data table - Dropdowns for selecting X-axis and Y-axis columns for charts
4. INTERACTIVE CHARTS (using Chart.js from CDN) - Tab interface to switch between: Bar, Line, Scatter, Pie - X-axis and Y-axis dropdowns (populated from column names) - For Bar and Pie: if X is categorical, auto-aggregate Y values by category (sum, average, or count -- let user pick) - For Line: if X is a date column, sort by date automatically - For Scatter: show individual data points with hover tooltips showing the full row - Charts resize responsively - Color palette: use a professional 8-color palette suitable for business presentations
5. DATA TABLE - Show all rows with column headers - Click any column header to sort ascending/descending (toggle with arrow indicator) - Search box that filters across all columns (case-insensitive) - Pagination: 50 rows per page with page navigation controls - Alternating row colors for readability - Numeric columns right-aligned, text columns left-aligned
6. EXPORT - "Download Filtered CSV" button exports only the currently filtered/visible rows - "Download Chart as PNG" button for the active chart (use Chart.js toBase64Image)
7. DESIGN - Dark theme: background #0f172a, cards #1e293b, text #e2e8f0, accent #3b82f6 - Clean sans-serif font (Inter from Google Fonts CDN) - Responsive layout that works on laptop screens (1366px+) - Include a "Load Sample Data" button that populates with a built-in dataset: a 50-row sales dataset with columns: Date, Region, Product, Units_Sold, Revenue, Cost, Profit (realistic quarterly business data) - Include a "Clear" button to reset everything
8. TECHNICAL - Pure HTML/CSS/JS in one file, no build step - Chart.js loaded from CDN (https://cdn.jsdelivr.net/npm/chart.js) - PapaParse loaded from CDN for robust CSV parsing - All processing happens client-side, no network requests after page loadThat entire block is the prompt. Paste it as-is. The specificity is deliberate — every detail about KPI cards, chart types, sort behavior, and the sample dataset is there so the LLM gives you exactly what you need on the first try. Vague prompts produce vague tools.
What you get
After the LLM finishes (typically 60-90 seconds), you will have a single file: analytics-dashboard.html. Open it in any browser.
Expected output structure
analytics-dashboard.html (~700-900 lines)Click Load Sample Data and you should see:
- KPI cards populate with row/column counts and summary stats for Units_Sold, Revenue, and Profit.
- Bar chart (default view) showing Revenue by Region — a classic BI visualization.
- Data table with all 50 rows, sortable by any column. Click “Revenue” to sort high-to-low.
- Switch to Line chart, set X to Date and Y to Revenue. The data auto-sorts by date and you see a revenue trend line.
- Switch to Scatter, set X to Units_Sold and Y to Profit. You can see the correlation between volume and profitability.
If something is off
LLMs occasionally produce code with small bugs. Open DevTools (F12 > Console) and copy the first red error message into your follow-up prompt — that gives the AI the context it needs to fix the issue. Here are the most common issues and one-line fix prompts:
| Problem | Follow-up prompt |
|---|---|
| CSV not parsing correctly | The CSV parser is breaking on quoted fields. Make sure PapaParse is loaded and called with header: true and dynamicTyping: true. |
| Charts blank after upload | Charts are not rendering. Make sure the Chart.js canvas is created after the data is parsed, and destroy any existing chart instance before creating a new one. |
| KPI numbers show NaN | The KPI calculation is failing. Filter out non-numeric values before computing sum/average/min/max. Use parseFloat and check with isNaN. |
| Sort not working | Table sorting is broken. Make sure the sort function handles both numeric and string comparisons. Use localeCompare for strings and subtraction for numbers. |
When things go wrong
The table above covers quick fixes, but here is a structured approach for the most common dashboard issues. Use the Symptom, Evidence, Request pattern — describe what you see, paste the error or screenshot context, and ask the AI for a targeted fix.
When Things Go Wrong
Use the Symptom → Evidence → Request pattern: describe what you see, paste the error, then ask for a fix.
How it works (the 2-minute explanation)
You do not need to understand every line of the generated code, but here is the mental model:
- CSV parsing with PapaParse handles edge cases you would otherwise spend hours debugging — quoted fields, embedded commas, different line endings. It outputs an array of objects where each key is a column name.
- Type detection iterates through the first 10 rows and tries to parse each column as a number, then a date. If neither works, it is categorical. This is similar to common spreadsheet type-inference heuristics.
- KPI computation is basic descriptive statistics:
reduce()for sum,sum/lengthfor average,Math.min/maxwith spread operator. Nothing fancy, but presented in a clean card layout it looks professional. - Chart.js renders bar, line, scatter, and pie charts from the same data — you just change the chart
typeproperty. Aggregation (grouping categoricals and summing numerics) is done with a simplereduce()into a Map. - Sorting uses
Array.prototype.sort()with a comparator function that checks the column type.
This dashboard implements ETL in miniature. The CSV upload is Extract. Auto-detecting types and parsing is Transform. Rendering KPIs and charts is Load (into a presentation layer). When you study data warehousing in MIS 441, you will see these same concepts at enterprise scale with tools like SSIS, Informatica, or dbt. The underlying logic is identical.
Customize it
The base dashboard is useful as-is, but the real power is in customization. Each of these is a single follow-up prompt:
Add pivot table functionality
Add a "Pivot Table" tab next to the charts. Let the user drag column names intoRow, Column, and Value areas. The value area should support Sum, Count, Average,Min, and Max aggregations. Render the pivot table as an HTML table with row andcolumn totals. This should work like a simplified Excel pivot table.Add conditional formatting to the data table
Add conditional formatting to numeric columns in the data table. For each numericcolumn, color-code cells using a green-yellow-red gradient based on the valuerelative to the column's min and max. Add a toggle button to turn conditionalformatting on/off.Add multiple file comparison
Allow uploading multiple CSV files. Show a file selector tab bar. Add a "Compare"view that overlays line charts from different files on the same axes (useful forcomparing monthly reports). Use different colors for each file with a legend.Add calculated columns
Add a "Calculated Column" button that lets the user define a new column using aformula like "Revenue - Cost" or "Units_Sold * 1.08". Parse simple arithmeticexpressions referencing existing column names. The new column should appear inthe data table and be available for charts.Notice the pattern: you start with a working tool, then add features one prompt at a time. Each prompt builds on what already exists. You never need to plan the entire tool upfront. This is exactly how real software development works with AI assistance.
🔍Connecting to Power BI and Tableau Workflows
The dashboard you just built mirrors the core workflow of enterprise BI tools. In Power BI, you connect to a data source (Extract), define measures and calculated columns (Transform), and build visuals on a canvas (Load). Tableau follows the same pattern with its data pane, shelf system, and worksheet canvas.
The difference is that your dashboard is a single file with zero dependencies. In a corporate setting, Power BI dashboards depend on a Power BI Service subscription, data gateway configuration, and Row-Level Security policies. Tableau requires a Tableau Server or Tableau Cloud license for sharing.
Understanding both approaches — the lightweight self-contained tool and the enterprise platform — makes you versatile. In interviews, you can say: “I understand what Power BI does under the hood because I have built the same pipeline from scratch. I also know when to use Power BI’s enterprise features like scheduled refresh, RLS, and embedded analytics.”
Real-world scenario: A hiring manager at a consulting firm gives candidates a messy CSV and 30 minutes to present findings. Candidates who open Excel take 25 minutes formatting. You open your dashboard in 5 seconds, explore the data visually, and spend 25 minutes on analysis and storytelling.
Try it yourself
- Open your CLI tool in an empty folder.
- Paste the main prompt from above.
- Open the generated
analytics-dashboard.htmlin your browser. - Click Load Sample Data and explore the built-in sales dataset.
- Now download a real CSV — try the Kaggle Superstore dataset (requires a free Kaggle account), a sample from data.gov, or any CSV from your coursework.
- Drag the file onto the upload area and see your data come alive.
- Pick one customization from the list above and add it with a follow-up prompt.
Key Takeaways
- One detailed prompt produces a complete BI tool. Specificity in your prompt (KPI card layout, chart types, sort behavior, sample data structure) is what gets you a working result on the first try.
- CSV parsing, type detection, and chart rendering are the building blocks of every BI tool. Whether you use Tableau, Power BI, or a hand-built dashboard, the underlying logic is the same: extract, transform, load.
- Iterative customization beats upfront planning. Start with a working foundation, then add pivot tables, conditional formatting, or calculated columns one prompt at a time.
- Client-side tools have real advantages. No license fees, no server dependencies, no data leaving your machine. For quick exploration before a formal analysis, this is faster than any enterprise tool.
- The prompt is your specification document. Treat it like a business requirements doc — the more precise your requirements, the better the deliverable.
Portfolio Suggestion
Save your analytics-dashboard.html file and any customized versions in a GitHub repository called mis-toolkit or business-analytics-portfolio. For maximum impact:
- Include a
README.mdwith a screenshot of the dashboard showing real data (not the sample). - Upload a 30-second screen recording showing the drag-and-drop upload, chart switching, and data table filtering.
- If you added customizations (pivot table, conditional formatting), call them out as separate features.
- Link to this from your LinkedIn profile under “Projects” — hiring managers in analytics and consulting roles specifically look for candidates who can demonstrate data visualization skills beyond “I know Tableau.”
You upload a CSV where the 'Revenue' column contains values like '$12,345.67'. The KPI cards display NaN. What is the most effective fix prompt to send to the AI?
What’s next
In the next lesson, you will build something more structured: a Database Schema Designer that takes plain English entity descriptions and generates ER diagrams, SQL CREATE TABLE statements, and sample data. Same pattern — showcase, prompt, output, customize — but with React and Vite instead of a single HTML file.