The context
Building Power BI reports is bottlenecked on two slow-to-acquire skills: writing correct DAX, and knowing where the answer actually lives in hours of training material. Analysts re-derive the same measures repeatedly, and learners get plausible-sounding but unverifiable AI answers. Teams also have no visibility into what their AI features actually cost. Datacense is an AI co-pilot built specifically for the Power BI workflow rather than a generic chatbot, pairing a chat workspace with specialized agents that span both doing analytics and learning it.
The problem, precisely
Writing DAX is the bottleneck. Producing correct, well-structured DAX measures is a specialized skill, and analysts repeatedly re-derive the same measures across reports and teams, with no shared library to reuse from.
AI answers you cannot trust. Generic chatbots return plausible-sounding but unverifiable answers about analytics concepts, with no link back to where the answer actually comes from in the training material.
Finished analyses are hard to share. Once an analysis is built, turning it into something a stakeholder can simply open via a link is awkward, so insights stay locked in tools rather than circulating as shareable artifacts.
AI spend is invisible. Platforms layering LLM features on top of their product typically have no per-feature visibility into what those AI calls actually cost, making it hard to manage spend.
What we built ✓ verified in code
Natural-language to DAX engine
A DAX agent that takes a business metric described in plain English and returns an indented, production-quality DAX measure plus a plain-English insight explaining what it does and when to use it, along with the DAX functions used as tags.
Semantic formula library with embedding cache
A curated DaxFormula library indexed with pgvector embeddings. Before any LLM call, the request is embedded and run through a nearest-neighbor search; a sufficiently close stored formula short-circuits generation entirely, saving cost and keeping recurring measures consistent.
Two-tier anti-hallucination RAG
A Learning Assistant that answers strictly from indexed course video transcripts. An LLM intent router filters off-topic questions, a high-confidence FAQ tier falls back to a full-transcript tier, and the system refuses to answer rather than fabricate. Answers cite the exact lesson video and timestamp.
Hosted analytics showcase pages
A publishing surface where self-contained HTML report and dashboard pages are uploaded and served at clean, auto-deduplicated public slugs, turning a finished analysis into a shareable link.
Per-feature AI cost instrumentation
A FinOps layer that pulls live OpenRouter model pricing and logs the USD cost and token counts of every LLM call, per feature, to an APIUsageLog with an admin view for monitoring AI spend.
How it works
- 1
Embed the request and check the library first. On a DAX request, the prompt is embedded with text-embedding-3-small and run through an L2-distance nearest-neighbor search via pgvector against the formula library. If the closest stored formula falls within the distance threshold, it is returned directly at zero LLM token cost.
- 2
Generate structured DAX when no match exists. If no close match is found, a strict system prompt instructs the model to return JSON with the title, category, difficulty, the business question answered, properly indented DAX code, a plain-English insight, and the DAX function names used as tags.
- 3
Route, retrieve, and cite for grounded answers. For course questions, an LLM intent router maps the question to a course and module and decides relevance, then metadata-filtered two-tier vector retrieval runs over PGVectorStore. A strict QA prompt synthesizes the answer with up to three deduped video citations including lesson names and timestamps.
- 4
Index transcripts asynchronously with timestamps. When a knowledge record is saved, a Django signal fires a django-q2 async task that downloads and parses the VTT transcript, groups captions into roughly ten-caption chunks each tagged with a normalized timestamp, and inserts the nodes into pgvector so answers can deep-link into the exact moment of a video.
- 5
Right-size models and log the cost of every call. Cheaper models handle narrow tasks like grading and a fast path, a stronger model handles creative content, and a web-search model is used only where freshness matters. Every call's USD cost and token counts are computed from cached live pricing and logged off the request thread to APIUsageLog.
The outcome
Datacense compresses the path from a business question to a production-ready measure, and from being stuck to finding the exact lesson that answers the question, all on a single platform. Semantic reuse answers near-duplicate DAX requests from the library at zero LLM cost while improving consistency, the two-tier RAG keeps answers grounded and cites the exact lesson video and timestamp, showcase hosting turns finished analyses into shareable URLs, and built-in FinOps keeps AI spend observable per feature. The result is an AI co-pilot purpose-built for the Power BI workflow rather than a generic chatbot.