{
  "source_file": "0930",
  "source_platform": "Medium",
  "author": "Ibrahim Salami",
  "title_listed": "Beyond the Flat Table: Building an Enterprise-Grade Financial Model in Power BI",
  "keywords": "",
  "domain": "数据处理",
  "content_type": "深度技术解析",
  "is_paid_flag": "否",
  "url": "https://towardsdatascience.com/beyond-the-flat-table-building-an-enterprise-grade-financial-model-in-power-bi/",
  "publish_date": "2026-01-10",
  "corpus_stage": "",
  "notes": "",
  "id": "c90ea54c6ed8",
  "collected_at": "2026-10-02T11:56:36",
  "title": "Beyond the Flat Table: Building an Enterprise-Grade Financial Model in Power BI | Towards Data Science",
  "body_markdown": "![Revisit consent button](../images/body-df29beacd7496220cc94.svg)\nWe value your privacy\nWe use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking \"Accept All\", you consent to our use of cookies.\nCustomise Reject All Accept All\nCustomise Consent Preferences ![](../images/body-2159bb67f3de8ad870eb.svg)\nWe use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.\nThe cookies that are categorised as \"Necessary\" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more\nNecessaryAlways Active\nNecessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.\n  * Cookie\nBCTempID\n  * Duration\n10 minutes\n  * Description\nNo description available.\n\n\n  * Cookie\n__cf_bm\n  * Duration\n1 hour\n  * Description\nThis cookie, set by Cloudflare, is used to support Cloudflare Bot Management. \n\n\n  * Cookie\nAWSALBCORS\n  * Duration\n7 days\n  * Description\nAmazon Web Services set this cookie for load balancing.\n\n\n  * Cookie\n_cfuvid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to track users across sessions to optimize user experience by maintaining session consistency and providing personalized services\n\n\n  * Cookie\nli_gc\n  * Duration\n6 months\n  * Description\nLinkedin set this cookie for storing visitor's consent regarding using cookies for non-essential purposes.\n\n\n  * Cookie\n__hssrc\n  * Duration\nsession\n  * Description\nThis cookie is set by Hubspot whenever it changes the session cookie. The __hssrc cookie set to 1 indicates that the user has restarted the browser, and if the cookie does not exist, it is assumed to be a new session.\n\n\n  * Cookie\n__hssc\n  * Duration\n1 hour\n  * Description\nHubSpot sets this cookie to keep track of sessions and to determine if HubSpot should increment the session number and timestamps in the __hstc cookie.\n\n\n  * Cookie\nwpEmojiSettingsSupports\n  * Duration\nsession\n  * Description\nWordPress sets this cookie when a user interacts with emojis on a WordPress site. It helps determine if the user's browser can display emojis properly.\n\n\n  * Cookie\nBCSessionID\n  * Duration\n1 year 1 month 4 days\n  * Description\nBlueconic sets this cookie as a unique identifier for the BlueConic profile.\n\n\n  * Cookie\n_octo\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nlogged_in\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\n__Secure-YEC\n  * Duration\npast\n  * Description\nYouTube sets this cookie to stores the user's video player preferences using embedded YouTube video\n\n\n  * Cookie\n__eoi\n  * Duration\n6 months\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTGCORS\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\nlogin-status-p\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTG\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\ncsrf_token\n  * Duration\nsession\n  * Description\nNo description available.\n\n\n  * Cookie\ntoken_v2\n  * Duration\n1 day\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nD\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nPHPSESSID\n  * Duration\nsession\n  * Description\nThis cookie is native to PHP applications. The cookie stores and identifies a user's unique session ID to manage user sessions on the website. The cookie is a session cookie and will be deleted when all the browser windows are closed.\n\n\n  * Cookie\nVISITOR_PRIVACY_METADATA\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to store the user's cookie consent state for the current domain. \n\n\n  * Cookie\ncookietest\n  * Duration\nsession\n  * Description\nThe cookietest cookie is typically used to determine whether the user's browser accepts cookies, essential for website functionality and user experience.\n\n\n  * Cookie\n__Host-airtable-session\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\n__Host-airtable-session.sig\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\nm\n  * Duration\n1 year 1 month 4 days\n  * Description\nStripe sets this cookie for fraud prevention purposes. It identifies the device used to access the website, allowing the website to be formatted accordingly.\n\n\n  * Cookie\nBIGipServer*\n  * Duration\nsession\n  * Description\nMarketo sets this cookie to collect information about the user's online activity and build a profile about their interests to provide advertisements relevant to the user. \n\n\n  * Cookie\n__cfruid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to identify trusted web traffic.\n\n\n  * Cookie\n_GRECAPTCHA\n  * Duration\n6 months\n  * Description\nGoogle Recaptcha service sets this cookie to identify bots to protect the website against malicious spam attacks.\n\n\n  * Cookie\n__Secure-YNID\n  * Duration\n6 months\n  * Description\nGoogle cookie used to protect user security and prevent fraud, especially during the login process.\n\n\n  * Cookie\ncookieyes-consent\n  * Duration\n1 year\n  * Description\nCookieYes sets this cookie to remember users' consent preferences so that their preferences are respected on subsequent visits to this site. It does not collect or store any personal information about the site visitors.\n\n\nFunctional\nFunctional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.\n  * Cookie\nlidc\n  * Duration\n1 day\n  * Description\nLinkedIn sets the lidc cookie to facilitate data center selection.\n\n\n  * Cookie\nbrw\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nbrwConsent\n  * Duration\n5 minutes\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nWMF-Uniq\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nloom_anon_comment\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nloom_referral_video\n  * Duration\nsession\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nVISITOR_INFO1_LIVE\n  * Duration\n6 months\n  * Description\nA cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.\n\n\n  * Cookie\nyt-remote-connected-devices\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nytidb::LAST_RESULT_ENTRY_KEY\n  * Duration\nNever Expires\n  * Description\nThe cookie ytidb::LAST_RESULT_ENTRY_KEY is used by YouTube to store the last search result entry that was clicked by the user. This information is used to improve the user experience by providing more relevant search results in the future.\n\n\n  * Cookie\nyt-remote-device-id\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-name\n  * Duration\nsession\n  * Description\nThe yt-remote-session-name cookie is used by YouTube to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\nyt-remote-fast-check-period\n  * Duration\nsession\n  * Description\nThe yt-remote-fast-check-period cookie is used by YouTube to store the user's video player preferences for embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-app\n  * Duration\nsession\n  * Description\nThe yt-remote-session-app cookie is used by YouTube to store user preferences and information about the interface of the embedded YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-available\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-available cookie is used to store the user's preferences regarding whether casting is available on their YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-installed\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-installed cookie is used to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\ncp_session\n  * Duration\n3 months\n  * Description\nCodepen sets this cookie for Help systems found in the website.\n\n\n  * Cookie\nloid\n  * Duration\n1 year 1 month 4 days\n  * Description\nThis cookie is set by the Reddit. The cookie enables the sharing of content from the website onto the social media platform.\n\n\nAnalytics\nAnalytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.\n  * Cookie\n__hstc\n  * Duration\n6 months\n  * Description\nHubspot set this main cookie for tracking visitors. It contains the domain, initial timestamp (first visit), last timestamp (last visit), current timestamp (this visit), and session number (increments for each subsequent session).\n\n\n  * Cookie\nhubspotutk\n  * Duration\n6 months\n  * Description\nHubSpot sets this cookie to keep track of the visitors to the website. This cookie is passed to HubSpot on form submission and used when deduplicating contacts.\n\n\n  * Cookie\n_ga\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors.\n\n\n  * Cookie\n_ga_*\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to store and count page views.\n\n\n  * Cookie\n__Host-psifi.analyticsTrace\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n__Host-psifi.analyticsTraceV2\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n_gh_sess\n  * Duration\nsession\n  * Description\nGitHub sets this cookie for temporary application and framework state between pages like what step the user is on in a multiple step form.\n\n\n  * Cookie\nYSC\n  * Duration\nsession\n  * Description\nYSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.\n\n\n  * Cookie\najs_anonymous_id\n  * Duration\n1 year\n  * Description\nThis cookie is set by Segment to count the number of people who visit a certain site by tracking if they have visited before.\n\n\n  * Cookie\nvuid\n  * Duration\n1 year 1 month 4 days\n  * Description\nVimeo installs this cookie to collect tracking information by setting a unique ID to embed videos on the website. \n\n\nPerformance\nPerformance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.\n  * Cookie\nAWSALB\n  * Duration\n7 days\n  * Description\nAWSALB is an application load balancer cookie set by Amazon Web Services to map the session to the target.\n\n\n  * Cookie\nacq\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nacq.sig\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nptc\n  * Duration\n2 years\n  * Description\nNo description available.\n\n\nAdvertisement\nAdvertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.\n  * Cookie\nmuc_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to collect user behaviour and interaction data to optimize the website.\n\n\n  * Cookie\nguest_id_marketing\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\nguest_id_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\npersonalization_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to integrate and share features for social media and also store information about how the user uses the website, for tracking and targeting.\n\n\n  * Cookie\nguest_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor. It registers if a user is signed in to the Twitter platform and collects information about ad preferences.\n\n\n  * Cookie\nbcookie\n  * Duration\n1 year\n  * Description\nLinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognize browser IDs.\n\n\n  * Cookie\n__Secure-ROLLOUT_TOKEN\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to manage feature rollout and experimentation. It helps Google control which new features or interface changes are shown to users as part of testing and staged rollouts, ensuring consistent experience for a given user during an experiment.\n\n\n  * Cookie\nyt.innertube::nextId\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nyt.innertube::requests\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nsession_tracker\n  * Duration\nsession\n  * Description\nThis cookie is set by the Reddit. This cookie is used to identify trusted web traffic. It also helps in adverstising on the website.\n\n\n  * Cookie\nedgebucket\n  * Duration\nsession\n  * Description\nReddit sets this cookie to save the information about a log-on Reddit user, for the purpose of advertisement recommendations and updating the content.\n\n\n  * Cookie\ndid\n  * Duration\n1 year\n  * Description\nArbor sets this cookie to show targeted ads to site visitors.This cookie expires after 2 months or 1 year.\n\n\nUncategorised\nOther uncategorised cookies are those that are being analysed and have not been classified into a category as yet.\nNo cookies to display.\nReject All Save My Preferences Accept All\nToggle Search[](https://towardsdatascience.com/)Toggle Mobile Navigation\n[](https://towardsdatascience.com/)\nPublish AI, ML & data-science insights to a global community of data professionals.\nSign in[Submit an Article](https://write.insightmediagroup.io)\n[Latest](https://towardsdatascience.com/latest/)[Editor's Picks](https://towardsdatascience.com/tag/editors-pick/)[Newsletter](https://towardsdatascience.com/tag/the-variable/)[ShipAI](https://towardsdatascience.com/shipai/)\n* * *\n[Write For TDS](https://towardsdatascience.com/submissions/)\n[LinkedIn](https://www.linkedin.com/company/towards-data-science/)[X](https://x.com/TDataScience)Toggle Search\n[Data Science](https://towardsdatascience.com/category/data-science/)\n# Beyond the Flat Table: Building an Enterprise-Grade Financial Model in Power BI\nA step-by-step journey through data transformation, star schema modeling, and DAX variance analysis with lessons learned along the way.\n[Ibrahim Salami](https://towardsdatascience.com/author/ibrahim.salami/)\nJanuary 10, 202610 min read\n![](../images/000.jpg)\nCreated with Gemini\nWe’ve all been there: You open Power BI, drag a messy Excel sheet into the canvas, and start dropping charts until something looks “right.” It’s easy, it’s intuitive, and honestly, that’s why Power BI is one of my favourite tools for data visualisation.\nBut as the world of data shifts toward end-to-end solutions like **Microsoft Fabric** , “just making it work” isn’t enough anymore. Large organisations need models that are performant, secure, and scalable.\nI’ve decided to challenge myself by taking the PL-300: Microsoft Data Analyst Associate exam. But instead of just grinding through practice tests or memorising definitions, I’m going into **“Practical Mode.”** If I’m going to get certified, I want to prove I can solve the problems real businesses actually face.\n## The Mission: The Enterprise-Grade Financial Suite\nFor my first project, I’m tackling the **Executive Financial Health Suite**.\nLearn this step by step with the interactive [AI and Data Scientist](https://roadmap.sh/ai-data-scientist) roadmap.\nWhy finance? Because in the enterprise world, it’s the ultimate test of your **Data Modeling** and **DAX** skills. Most “generic” tutorials use a single, flat table. But in a real company, data is fragmented. You have “Actuals” (what happened) sitting in one place and “Budgets” (the goal) sitting in another, usually at different levels of detail.\nIn this project, I’m going to document how I:\n  * **Deconstruct a “Flat Table”** into a clean, professional Star Schema.\n  * **Handle the “Grain” Problem** (comparing daily sales vs. monthly budgets).\n  * **Master DAX** for those high-stakes metrics like Year-to-Date (YTD) and Variance %.\n\n\nI’m sharing my journey in public so that if you’re also preparing for the PL-300, you can follow along, build these solutions with me, and understand the _why_ behind the architecture — not just the _how_.  \nFor this project, we are using the **Microsoft Financial Sample**. It’s the perfect “blank canvas” because it comes as a flat, “messy” table that we have to re-engineer professionally.\n> **How to get it:** In Power BI Desktop, go to **Home > Sample Dataset > Load Sample Data**. Select the **financials** table.\nLet’s get our hands dirty in Power Query.\n## Phase 1: Data Transformation (Power Query)\nBefore touching DAX or visuals, I slowed myself down and spent real time in **Power Query**. This is the part I used to rush through. Now I treat it as the foundation of everything that follows.  \nIf the data model is shaky, no amount of clever DAX will save you.\n### Step 1: Data Profiling (a quick reality check)\nOnce I loaded the Microsoft Financial Sample dataset, the first thing I did was **turn on column profiling** :\n  * Column quality\n  * Column distribution\n  * Column profile\n\n\nWhen I turn on **Column quality, distribution, and profile** , I’m not trying to be thorough for the sake of it. I’m scanning for **model-breaking issues** _before_ they turn into DAX headaches.\nColumn profiling immediately tells you:\n  * Where nulls are hiding\n  * Which columns are pretending to be dimensions\n  * Which fields _look_ numeric but behave like text\n\n\n**1. Nulls & Data Type Mismatches**\nI think we’re good. Empty values are 0% all through, valid are 100%, and errors are 0%. Data types are all good, also. Probably because we’re using the sample financials dataset, there shouldn’t be any issues\n**2. Cardinality: What Wants to Be a Dimension**\nCardinality is simply **how many unique values a column has**. Power BI surfaces this immediately in **Column distribution** , and once you start paying attention to it, modeling decisions get much easier.\nHere’s my rule of thumb:\n  * **Low cardinality** (values repeat a lot) → likely a dimension\n  * **High cardinality** (values are mostly unique) → fact-level detail\n\n\nWhen I turn on column distribution, I’m asking two questions:\n  * _How many distinct values does this column have?_\n  * _Do those values repeat enough to be useful for filtering or grouping?_\n\n\nIf a column looks categorical but has thousands of distinct values, that’s a red flag.\nOnce I turned on **Column distribution** , the dataset started sorting itself for me.\nSome columns immediately showed **low cardinality** — they repeated often and behaved like true categories:\n  * Segment\n  * Country\n  * Product\n  * Discount Band\n  * Manufacturing Price\n  * Sales Price\n  * Date attributes (Year, Month Number, Month Name)\n\n\nThese columns had relatively few distinct values and clear repetition across rows. That’s a strong signal: _these want to be used for grouping, slicing, and relationships_. In other words, they naturally belong on the **dimension side** of a star schema.\nThen there were the columns on the other end of the spectrum.\nMeasures like:\n  * Units Sold\n  * Gross Sales\n  * Discounts\n  * Sales\n  * COGS\n  * Profit\n\n\n...showed **very high cardinality**. Many values were unique or nearly unique per row, with wide numeric ranges. That’s exactly what I expect from **fact-level metrics** — they’re meant to be aggregated, not filtered on.\nThat insight directly informed my next step: using **Reference** in Power Query to spin off `Dim_Product` and `Dim_Geography`, instead of guessing or forcing the structure.\n### Step 2: Spinning Dimensions with Reference (Not Duplicate)\nThis is the point where I stopped treating the dataset as a report-ready table and started treating it as a **model-in-progress**.  \nIn Power Query, it’s tempting to right-click a table and hit **Duplicate**. I used to do that all the time. It works — but it quietly creates problems you only feel later.\nInstead, I used **Reference**.  \nWhy reference instead of duplicate? You might ask\nWhen you create a referenced table:\n  * It inherits all upstream transformations\n  * It stays logically tied to the source\n  * Any fix in the fact table automatically flows downstream\n\n\nFrom a real-world perspective, it’s just… safer.\nHere’s how I created `Dim_Product & Dim_Geography`\nStarting from the main financial table:\n  * I right-clicked the query and selected **Reference**\n  * Renamed the new query to `Dim_Product`\n  * Kept only product-related columns (Product, Segment, Discount Band)\n  * Removed duplicates\n  * Ensured clean data types and naming\n\n\nWhat I ended up with was a small, stable table with **low cardinality** — perfect for slicing and grouping.\nI repeated the same approach for geography:\n  * Reference the fact table\n  * Keep the Country column\n  * Remove duplicates\n  * Clean text values\n\n\n> P.S. In this dataset, geography is represented only at the country level. Rather than forcing a region or city hierarchy that doesn’t exist, I modeled Country as a lean, single-column dimension.\n### Step 3: Create a Dynamic Date Table\nHere’s where I see a lot of Power BI models quietly fail PL-300 standards.\n  * I didn’t import a static calendar.\n  * I didn’t manually generate dates.\n  * I built a **dynamic date table in Power Query** based on the data itself.\n\n\nWhy this matters:\n  * It guarantees **no missing dates**\n  * It automatically adjusts when new data arrives\n  * It aligns perfectly with Microsoft’s modeling best practices\n\n\n> To create a dynamic date table. Just click on **Load - > Blank Query -> Advanced Editor** and paste this code in\nBelow is the exact **M code** I used\npowerquery\n\n```\nlet\nSource = Financials,\nMinDate = Date.From(List.Min(Source[Date])),\nMaxDate = Date.From(List.Max(Source[Date])),\nDateList = List.Dates(\nMinDate,\nDuration.Days(MaxDate — MinDate) + 1,\n#duration(1, 0, 0, 0)\n),\nDateTable = Table.FromList(DateList, Splitter.SplitByNothing(), {“Date”}),\nAddYear = Table.AddColumn(DateTable, “Year”, each Date.Year([Date]), Int64.Type),\nAddMonthNum = Table.AddColumn(AddYear, “Month Number”, each Date.Month([Date]), Int64.Type),\nAddMonthName = Table.AddColumn(AddMonthNum, “Month Name”, each Date.MonthName([Date]), type text),\nAddQuarter = Table.AddColumn(AddMonthName, “Quarter”, each “Q” & Number.ToText(Date.QuarterOfYear([Date])), type text),\nAddDay = Table.AddColumn(AddQuarter, “Day”, each Date.Day([Date]), Int64.Type)\nin\nAddDay\n```\n\nThis calendar:\n  * Covers **every date** in the dataset\n  * Scales automatically\n  * Is ready for time intelligence the moment it hits the model\n\n\nOnce loaded, I marked it as a **Date Table** in the model view — non-negotiable for PL-300.\nBy the end of Phase 1, I had:\n  * A clean fact table\n  * Proper dimension tables created via **Reference**\n  * A dynamic, gap-free date table\n  * Transformations I could actually explain to another analyst\n\n\nNothing flashy yet — but this is the phase that makes everything _after_ it easier, faster, and more reliable.\nIn the next section, I’ll move into **data modeling and relationships** , where this structure really starts paying dividends.\n## Phase 2: Data Modeling (From Tables to a Star Schema)\nThis is the phase where Power BI starts behaving like a **semantic model**.\nBy the time I switched to the **Model view** , I already had:\n  * A clean fact table\n  * Lean dimensions created via _Reference_\n  * A dynamic, gap-free date table\n\n\nNow the goal was simple: **connect everything cleanly and intentionally**.\n### Step 1: Establishing the Star Schema\nI aimed for a classic **star schema** :\n  * One central fact table (financial metrics)\n  * Surrounding dimension tables (`Dim_Date`, `Dim_Product`, `Dim_Geography`)\n\n\n  \nEvery relationship needed to answer three questions:\n  * Which table is the “one” side?\n  * Which table is the “many” side?\n  * Does this relationship make sense at the grain of the data?\n\n\nYou might notice that I didn’t introduce surrogate keys for the fact or dimension tables. In this dataset, the natural keys — Country, Product, and Date — are stable, low-cardinality, and unambiguous. For this model, adding artificial IDs would increase complexity without improving clarity or performance.\nHere’s how the overall model looks:\n![](../images/001.png)\n### Step 2: Relationship Direction (Single, on Purpose)\nAll relationships were set to:\n  * **Many-to-one**\n  * **Single direction** , flowing from dimension → fact\n\n\nFor PL-300 and real-world models alike, **single-direction filters are the default** until there’s a strong reason not to use them.\n### Step 3: Date Table as the Anchor\nThe dynamic date table I created earlier now became the **backbone** of the model.\nI:\n  * Related `Dim_Date[Date]` to the fact table’s date column\n  * Marked `Dim_Date` as the official Date Table\n  * Hid the raw date column in the fact table\n\n\nThis does three important things:\n  * Enables time intelligence\n  * Prevents accidental use of the wrong date field\n  * Forces consistency across measures\n\n\nFrom here on out, every time-based calculation flows through this table — no exceptions.\n### Step 4: Hiding What Users Don’t Need\nThis is a small step with an outsized impact. PL-300 explicitly tests this idea that the model shouldn't be just correct — it should be **usable**.\nI hid:\n  * Foreign keys (Date, Product, Country). If a column exists only to create relationships, it doesn’t need to appear in the Fields pane.\n  * Raw numeric columns that should only be used in measures. After creating my DAX measures (e.g. Total Sales, Total Profit). I can go ahead and hide raw numeric columns (like Units Sold, Gross Sales, Discounts, Sales, COGS, Profit) from my fact table. These nudges users toward correct and consistent aggregations\n  * Duplicate date attributes in the fact Table (Year, Month, Month Number). These already exist in the date table.\n\n\n### Step 5: Validating the Model (Before Writing DAX)\nBefore touching any measures, I did a quick sanity check:\n  * Does slicing by Country behave correctly?\n  * Do Product and Segment filter as expected?\n  * Do dates aggregate cleanly by Year and Month?\n\n\nIf something breaks here, it’s a modeling issue — not a DAX issue.\nTo test this, I created a quick visual checking the Sum of Profit by Year. Here’s how it turned out:\n![](../images/body-c0d8071dd9cbbc0bd266.png)\nSo far so good! Now we can move on to creating our DAX measures.\n## Phase 3: DAX Measures & Variance Analysis (Where the Model Starts to Shine)\nThis is the phase where the work I’d done in Power Query and the model really started paying off. Honestly, it’s the first time in a while that writing DAX _didn’t feel like fighting the table_. The star schema made everything… predictable.\n### Step 1: Base Measures — the foundation of sanity\nI resisted my old instinct to drag raw columns into visuals. Instead, I created explicit measures for everything I cared about:\npowerquery\n\n```\nTotal Sales :=\nSUM ( financials[ Sales])\n\nTotal Profit :=\nSUM ( financials[Profit] )\n\nTotal Units Sold :=\nSUM ( financials[Units Sold] )\n\nTotal COGS :=\nSUM ( financials[COGS])\n```\n\n### Step 2: Time intelligence without surprises\nBecause I already had a complete, properly marked date table, things like year-to-date or prior year comparisons were effortless.\n**Sales Year-to-Date**\npowerquery\n\n```\nSales YTD :=\nTOTALYTD (\n[Total Sales],\n‘Dim_Date’[Date]\n)\n```\n\n**Sales Prior Year**\npowerquery\n\n```\nSales PY :=\nCALCULATE (\n[Total Sales],\nSAMEPERIODLASTYEAR ( ‘Dim_Date’[Date] )\n)\n```\n\n### Step 3: Variance measures — turning numbers into insight\nOnce I had Actual vs Prior Period, I could calculate variance with almost no extra effort:\npowerquery\n\n```\nSales YoY Variance :=\n[Total Sales] — [Sales PY]\n\nSales YoY % :=\nDIVIDE (\n[Sales YoY Variance],\n[Sales PY]\n)\n```\n\nSame approach for month-over-month:\npowerquery\n\n```\nSales PM :=\nCALCULATE (\n[Total Sales],\nDATEADD ( 'Dim_Date'[Date], -1, MONTH )\n)\n\nSales MoM Variance :=\n[Total Sales] - [Sales PM]\n\nSales MoM % :=\nDIVIDE (\n[Sales MoM Variance],\n[Sales PM]\n)\n```\n\n### Step 4: Why this actually feels “easy”\nHere’s the honest part: writing DAX didn’t feel like the hardest thing. The hard part was everything that came _before_ :\n  * Cleaning the data\n  * Profiling columns\n  * Spinning out dimensions with Reference\n  * Building a solid date table\n\n\nBy the time I got here, the DAX was just **adding value** instead of patching holes.\n> Good DAX isn’t clever — it’s predictable, trustworthy, and easy to explain.\n## Conclusion\nThe magic wasn’t in any single DAX formula — it was in how the model came together. By profiling the data early, understanding cardinality, and spinning dimensions with **Reference** , I built a structure that just works. A dynamic date table and clean relationships meant time intelligence measures and variance calculations ran effortlessly.\nHiding unnecessary fields and grouping measures thoughtfully made the model approachable, even for someone else exploring it for the first time. By the time I wrote the DAX for Actual vs. Prior Period or Month-over-Month variance, everything felt predictable and trustworthy.\nIf you want to see the full semantic model in action, including all the tables, relationships, and measures, you can **download it**[**here**](https://github.com/ibbysalam/Enterprise-Grade-Financial-Model-in-Power-BI) and explore how it ties together. There’s no better way to learn than seeing a working model in Power BI and experimenting with it yourself.\nWanna connect? Feel free to say hi on any of the platforms below\n[Medium](https://medium.com/@ibbysalam)\n[LinkedIn](https://www.linkedin.com/in/ibrahim-salami-059863228/)\n[Twitter](https://x.com/IbbySalam)\n[YouTube](https://www.youtube.com/@ibbysalam)\n## Register Now to Continue Reading\n### Unlock Towards Data Science with a Free Account\nAll articles on Towards Data Science are available to registered users. Create a free account today to access this article and thousands more.\nRegister for freeSign in to your account\n* * *\n![](../images/body-542334df68a32cd56c4a.jpeg)\nWritten By\n## [Ibrahim Salami](https://towardsdatascience.com/author/ibrahim.salami/)\n[See all from Ibrahim Salami](https://towardsdatascience.com/author/ibrahim.salami/)\n[Busines Intelligence](https://towardsdatascience.com/tag/busines-intelligence/)[Data Analytics](https://towardsdatascience.com/tag/data-analytics/)[Data Modeling](https://towardsdatascience.com/tag/data-modeling/)[Data Visualization](https://towardsdatascience.com/tag/data-visualization/)[Power Bi](https://towardsdatascience.com/tag/power-bi/)\nShare This Article\n  * [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ftowardsdatascience.com%2Fbeyond-the-flat-table-building-an-enterprise-grade-financial-model-in-power-bi%2F&title=Beyond%20the%20Flat%20Table%3A%20Building%20an%20Enterprise-Grade%20Financial%20Model%20in%20Power%C2%A0BI)\n  * [](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Ftowardsdatascience.com%2Fbeyond-the-flat-table-building-an-enterprise-grade-financial-model-in-power-bi%2F&title=Beyond%20the%20Flat%20Table%3A%20Building%20an%20Enterprise-Grade%20Financial%20Model%20in%20Power%C2%A0BI)\n  * [](https://x.com/share?url=https%3A%2F%2Ftowardsdatascience.com%2Fbeyond-the-flat-table-building-an-enterprise-grade-financial-model-in-power-bi%2F&text=Beyond%20the%20Flat%20Table%3A%20Building%20an%20Enterprise-Grade%20Financial%20Model%20in%20Power%C2%A0BI)\n\n\nTowards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program.\n[Write for TDS](https://towardsdatascience.com/submissions/)\n## Related Articles\n  * [![](../images/002.jpg)](https://towardsdatascience.com/sql-to-sarimax-how-i-navigate-the-first-time-series-analysis-personal-project-for-my-portfolio-1ed24cba2c52/)\n## [SQL to SARIMAX: How I navigate the first time-series analysis personal project for my portfolio](https://towardsdatascience.com/sql-to-sarimax-how-i-navigate-the-first-time-series-analysis-personal-project-for-my-portfolio-1ed24cba2c52/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nIncluding the resources I used to learn time-series as I was doing this project (MySQL, ARIMA orders selection, parallelization in Jupyter...\n[Irene Chang](https://towardsdatascience.com/author/irenechang1510/)\nApril 6, 202210 min read\n  * [![](../images/003.jpeg)](https://towardsdatascience.com/data-stacks-for-fun-nonprofit-part-ii-d375d824abf3/)\n## [Data Stacks For Fun & Nonprofit - Part II](https://towardsdatascience.com/data-stacks-for-fun-nonprofit-part-ii-d375d824abf3/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nDesigning a complete data stack with Meltano, DBT and Superset.\n[Andrew Stewart](https://towardsdatascience.com/author/andrewcstewart/)\nSeptember 27, 202011 min read\n  * [![](../images/004.jpeg)](https://towardsdatascience.com/ethics-in-ai-potential-root-causes-for-biased-algorithms-890091915aa3/)\n## [Ethics in AI: Potential Root Causes for Biased Algorithms](https://towardsdatascience.com/ethics-in-ai-potential-root-causes-for-biased-algorithms-890091915aa3/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nAn alternative approach to understanding bias in data\n[Jonas Dieckmann](https://towardsdatascience.com/author/jonas_dieckmann/)\nJanuary 27, 202310 min read\n  * [![](../images/005.jpg)](https://towardsdatascience.com/the-price-is-too-damn-high-part-1-9b32e13a8b3/)\n## [The Price is Too Damn High: Part 1](https://towardsdatascience.com/the-price-is-too-damn-high-part-1-9b32e13a8b3/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nA look at submitted Medicare charges by state in 2017 and 2012\n[Anne Bode](https://towardsdatascience.com/author/annebode/)\nNovember 19, 202013 min read\n  * [![](../images/006.png)](https://towardsdatascience.com/analysis-with-pandas-matplotlib-and-folium-spanish-courses-for-foreigners-in-the-municipal-31e93fb3656f/)\n## [Analysis with Pandas, Matplotlib, and Folium -Spanish courses for foreigners in the Municipal...](https://towardsdatascience.com/analysis-with-pandas-matplotlib-and-folium-spanish-courses-for-foreigners-in-the-municipal-31e93fb3656f/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nSide-by-side bar charts, stacked bar plots, pie plots, and cloropleth maps\n[Amanda Iglesias Moreno](https://towardsdatascience.com/author/amandaiglesiasmoreno/)\nFebruary 5, 20204 min read\n  * [![](../images/007.jpeg)](https://towardsdatascience.com/20-numpy-operations-that-every-data-scientist-should-know-fb44bb52bde5/)\n## [20 NumPy Operations That Every Data Scientist Should Know](https://towardsdatascience.com/20-numpy-operations-that-every-data-scientist-should-know-fb44bb52bde5/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nNumPy forms the basis of many Python libraries in the data science domain.\n[Soner Yıldırım](https://towardsdatascience.com/author/sonery/)\nAugust 29, 20205 min read\n  * [![](../images/008.jpeg)](https://towardsdatascience.com/data-analysts-primer-to-slowly-changing-dimensions-d087c8327e08/)\n## [Data Analyst's Primer to Slowly Changing Dimensions](https://towardsdatascience.com/data-analysts-primer-to-slowly-changing-dimensions-d087c8327e08/)\n[](https://towardsdatascience.com/beyond-the-flat-table-building-an-enterprise-grade-financial-model-in-power-bi/)\nData Analyst interviews will typically entail both technical and behavioral components.\n[Nick Vega](https://towardsdatascience.com/author/nvega-1989/)\nApril 25, 20218 min read\n  * [![](../images/009.jpeg)](https://towardsdatascience.com/aesthetic-epistemology-a-review-of-erna-fiorentinis-inducing-visibilities-3d61919593c3/)\n## [Aesthetic Epistemology: A Review of Erna Fiorentini's\"Inducing Visibilities...\"](https://towardsdatascience.com/aesthetic-epistemology-a-review-of-erna-fiorentinis-inducing-visibilities-3d61919593c3/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nA Brief Review of \"Inducing visibilities: An attempt at Santiago Ramón y Cajal's aesthetic epistemology\"...\n[Jesse Ruiz (she/they)](https://towardsdatascience.com/author/jjr8888/)\nMay 24, 20213 min read\n  * [![](../images/010.jpeg)](https://towardsdatascience.com/product-quasi-experimentation-statistical-techniques-when-standard-a-b-testing-is-not-possible-68d516a59b1c/)\n## [Product Quasi-Experimentation: Statistical Techniques When Standard A/B Testing Is Not Possible](https://towardsdatascience.com/product-quasi-experimentation-statistical-techniques-when-standard-a-b-testing-is-not-possible-68d516a59b1c/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nA guide to the most popular techniques when randomized A/B testing is not possible\n[Magda Ntetsika](https://towardsdatascience.com/author/ntetsika.magda/)\nJuly 19, 20246 min read\n\n\n  * [YouTube](https://www.youtube.com/c/TowardsDataScience)\n  * [X](https://x.com/TDataScience)\n  * [LinkedIn](https://www.linkedin.com/company/towards-data-science/)\n  * [Threads](https://www.threads.net/@towardsdatascience)\n  * [Bluesky](https://bsky.app/profile/towardsdatascience.com)\n\n\n[](https://towardsdatascience.com/)\nYour home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.\nSubscribe to Our Newsletter[Write For TDS](https://towardsdatascience.com/submissions/)•[About](https://towardsdatascience.com/about-towards-data-science-d691af11cc2f/)•[Advertise](https://contact.towardsdatascience.com/advertise-with-towards-data-science)•[Privacy Policy](https://towardsdatascience.com/privacy-policy/)•[Terms of Use](https://towardsdatascience.com/website-terms-of-use/)\n© Insight Media Group, LLC 2026•[The New Stack](https://thenewstack.io)•[roadmap.sh](https://roadmap.sh)•[Creator Network](https://insightmediagroup.io/creator-network)\n####  Recommended Articles \nClose\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500) Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1 ](https://towardsdatascience.com/javascript-fatigue-you-dont-need-js-to-build-chatgpt/ \"Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500) The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs ](https://towardsdatascience.com/subset-sum-problem-solved-in-linear-time-for-dense-enough-inputs/ \"The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500) Does Your Company Have a Data Strategy? ](https://towardsdatascience.com/does-your-company-have-a-data-strategy-e8944dbec4ae/ \"Does Your Company Have a Data Strategy?\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/4970/image?etag=1780565225463&width=500&height=500) Productivity Tips, Data Career Insights, and Other Recent Must-Reads ](https://towardsdatascience.com/productivity-tips-data-career-insights-and-other-recent-must-reads-5c47eb7a2fe0/ \"Productivity Tips, Data Career Insights, and Other Recent Must-Reads\")\n\n\n",
  "metadata": {
    "title": "Beyond the Flat Table: Building an Enterprise-Grade Financial Model in Power BI | Towards Data Science",
    "description": "A step-by-step journey through data transformation, star schema modeling, and DAX variance analysis with lessons learned along the way.",
    "keywords": null,
    "author": "Ibrahim Salami",
    "og:locale": "en_US",
    "og:type": "article",
    "og:title": "Beyond the Flat Table: Building an Enterprise-Grade Financial Model in Power BI",
    "og:description": "A step-by-step journey through data transformation, star schema modeling, and DAX variance analysis with lessons learned along the way.",
    "og:url": "https://towardsdatascience.com/beyond-the-flat-table-building-an-enterprise-grade-financial-model-in-power-bi/",
    "og:site_name": "Towards Data Science",
    "og:image": "https://assets.insightmediagroup.io/media/wp-content/uploads/2026/01/data-modeling-img-1.jpg",
    "og:image:width": "709",
    "og:image:height": "621",
    "og:image:type": "image/jpeg",
    "twitter:card": "summary_large_image",
    "twitter:site": "@TDataScience",
    "twitter:creator": "@TDataScience",
    "twitter:label1": "Written by",
    "twitter:data1": "Ibrahim Salami",
    "twitter:label2": "Est. reading time",
    "twitter:data2": "10 min read",
    "article:published_time": "2026-01-10T08:00:06.000Z",
    "article:modified_time": "2026-01-10T08:00:06.000Z",
    "article:author": "https://towardsdatascience.com/author/ibrahim.salami/"
  },
  "paywall": {
    "listed_paid": false,
    "detected": false,
    "marker": "",
    "public_only": false,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 202,
    "error": ""
  },
  "code_blocks": [
    {
      "language": "txt",
      "file": "attachments/c90ea54c6ed8/code/block_000.txt",
      "chars": 768
    },
    {
      "language": "txt",
      "file": "attachments/c90ea54c6ed8/code/block_001.txt",
      "chars": 176
    },
    {
      "language": "txt",
      "file": "attachments/c90ea54c6ed8/code/block_002.txt",
      "chars": 58
    },
    {
      "language": "txt",
      "file": "attachments/c90ea54c6ed8/code/block_003.txt",
      "chars": 81
    },
    {
      "language": "txt",
      "file": "attachments/c90ea54c6ed8/code/block_004.txt",
      "chars": 109
    },
    {
      "language": "txt",
      "file": "attachments/c90ea54c6ed8/code/block_005.txt",
      "chars": 191
    }
  ],
  "images": [
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:40:15Z"
    },
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:40:15Z"
    },
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:40:15Z"
    },
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/4970/image?etag=1780565225463&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/4970/image?etag=1780565225463&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:40:15Z"
    }
  ],
  "audio": [],
  "videos": [
    {
      "url": "https://www.youtube.com/@ibbysalam",
      "kind": "channel_reference",
      "status": "reference_only"
    },
    {
      "url": "https://www.youtube.com/c/TowardsDataScience",
      "kind": "channel_reference",
      "status": "reference_only"
    }
  ],
  "links": [
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/latest/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/editors-pick/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/the-variable/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/shipai/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/submissions/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/category/data-science/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/ibrahim.salami/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/busines-intelligence/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/data-analytics/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/data-modeling/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/data-visualization/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/power-bi/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/sql-to-sarimax-how-i-navigate-the-first-time-series-analysis-personal-project-for-my-portfolio-1ed24cba2c52/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/irenechang1510/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/data-stacks-for-fun-nonprofit-part-ii-d375d824abf3/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/andrewcstewart/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/ethics-in-ai-potential-root-causes-for-biased-algorithms-890091915aa3/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/jonas_dieckmann/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/the-price-is-too-damn-high-part-1-9b32e13a8b3/"
    },
    {
      "type": "external",
      "href": "https://write.insightmediagroup.io"
    },
    {
      "type": "external",
      "href": "https://www.linkedin.com/company/towards-data-science/"
    },
    {
      "type": "external",
      "href": "https://x.com/TDataScience"
    },
    {
      "type": "external",
      "href": "https://roadmap.sh/ai-data-scientist"
    },
    {
      "type": "external",
      "href": "https://github.com/ibbysalam/Enterprise-Grade-Financial-Model-in-Power-BI"
    },
    {
      "type": "external",
      "href": "https://medium.com/@ibbysalam"
    },
    {
      "type": "external",
      "href": "https://www.linkedin.com/in/ibrahim-salami-059863228/"
    },
    {
      "type": "external",
      "href": "https://x.com/IbbySalam"
    },
    {
      "type": "external",
      "href": "https://www.youtube.com/@ibbysalam"
    },
    {
      "type": "external",
      "href": "https://www.facebook.com/sharer/sharer.php?title=Beyond+the+Flat+Table%3A+Building+an+Enterprise-Grade+Financial+Model+in+Power%C2%A0BI&u=https%3A%2F%2Ftowardsdatascience.com%2Fbeyond-the-flat-table-building-an-enterprise-grade-financial-model-in-power-bi%2F"
    },
    {
      "type": "external",
      "href": "https://www.linkedin.com/shareArticle?mini=true&title=Beyond+the+Flat+Table%3A+Building+an+Enterprise-Grade+Financial+Model+in+Power%C2%A0BI&url=https%3A%2F%2Ftowardsdatascience.com%2Fbeyond-the-flat-table-building-an-enterprise-grade-financial-model-in-power-bi%2F"
    },
    {
      "type": "external",
      "href": "https://x.com/share?text=Beyond+the+Flat+Table%3A+Building+an+Enterprise-Grade+Financial+Model+in+Power%C2%A0BI&url=https%3A%2F%2Ftowardsdatascience.com%2Fbeyond-the-flat-table-building-an-enterprise-grade-financial-model-in-power-bi%2F"
    },
    {
      "type": "external",
      "href": "https://www.youtube.com/c/TowardsDataScience"
    },
    {
      "type": "external",
      "href": "https://www.threads.net/@towardsdatascience"
    },
    {
      "type": "external",
      "href": "https://bsky.app/profile/towardsdatascience.com"
    },
    {
      "type": "external",
      "href": "https://thenewstack.io"
    },
    {
      "type": "external",
      "href": "https://roadmap.sh"
    },
    {
      "type": "external",
      "href": "https://insightmediagroup.io/creator-network"
    }
  ],
  "repair_version": 2,
  "repaired_at": "2026-10-20T17:24:45Z",
  "source_url": "https://towardsdatascience.com/beyond-the-flat-table-building-an-enterprise-grade-financial-model-in-power-bi/",
  "delivery_status": "unverified",
  "discovery_status": "http_403",
  "missing_reason": "源页面未重新核验:http_403；已按保留正文补采图片",
  "repair_error": "",
  "actual_video_files": [],
  "expected_saved_body_images": 4,
  "image_discovery": "saved_markdown",
  "source_body_markdown": "![Revisit consent button](https://cdn-cookieyes.com/assets/images/revisit.svg)\nWe value your privacy\nWe use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking \"Accept All\", you consent to our use of cookies.\nCustomise Reject All Accept All\nCustomise Consent Preferences ![](https://cdn-cookieyes.com/assets/images/close.svg)\nWe use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.\nThe cookies that are categorised as \"Necessary\" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more\nNecessaryAlways Active\nNecessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.\n  * Cookie\nBCTempID\n  * Duration\n10 minutes\n  * Description\nNo description available.\n\n\n  * Cookie\n__cf_bm\n  * Duration\n1 hour\n  * Description\nThis cookie, set by Cloudflare, is used to support Cloudflare Bot Management. \n\n\n  * Cookie\nAWSALBCORS\n  * Duration\n7 days\n  * Description\nAmazon Web Services set this cookie for load balancing.\n\n\n  * Cookie\n_cfuvid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to track users across sessions to optimize user experience by maintaining session consistency and providing personalized services\n\n\n  * Cookie\nli_gc\n  * Duration\n6 months\n  * Description\nLinkedin set this cookie for storing visitor's consent regarding using cookies for non-essential purposes.\n\n\n  * Cookie\n__hssrc\n  * Duration\nsession\n  * Description\nThis cookie is set by Hubspot whenever it changes the session cookie. The __hssrc cookie set to 1 indicates that the user has restarted the browser, and if the cookie does not exist, it is assumed to be a new session.\n\n\n  * Cookie\n__hssc\n  * Duration\n1 hour\n  * Description\nHubSpot sets this cookie to keep track of sessions and to determine if HubSpot should increment the session number and timestamps in the __hstc cookie.\n\n\n  * Cookie\nwpEmojiSettingsSupports\n  * Duration\nsession\n  * Description\nWordPress sets this cookie when a user interacts with emojis on a WordPress site. It helps determine if the user's browser can display emojis properly.\n\n\n  * Cookie\nBCSessionID\n  * Duration\n1 year 1 month 4 days\n  * Description\nBlueconic sets this cookie as a unique identifier for the BlueConic profile.\n\n\n  * Cookie\n_octo\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nlogged_in\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\n__Secure-YEC\n  * Duration\npast\n  * Description\nYouTube sets this cookie to stores the user's video player preferences using embedded YouTube video\n\n\n  * Cookie\n__eoi\n  * Duration\n6 months\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTGCORS\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\nlogin-status-p\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTG\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\ncsrf_token\n  * Duration\nsession\n  * Description\nNo description available.\n\n\n  * Cookie\ntoken_v2\n  * Duration\n1 day\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nD\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nPHPSESSID\n  * Duration\nsession\n  * Description\nThis cookie is native to PHP applications. The cookie stores and identifies a user's unique session ID to manage user sessions on the website. The cookie is a session cookie and will be deleted when all the browser windows are closed.\n\n\n  * Cookie\nVISITOR_PRIVACY_METADATA\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to store the user's cookie consent state for the current domain. \n\n\n  * Cookie\ncookietest\n  * Duration\nsession\n  * Description\nThe cookietest cookie is typically used to determine whether the user's browser accepts cookies, essential for website functionality and user experience.\n\n\n  * Cookie\n__Host-airtable-session\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\n__Host-airtable-session.sig\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\nm\n  * Duration\n1 year 1 month 4 days\n  * Description\nStripe sets this cookie for fraud prevention purposes. It identifies the device used to access the website, allowing the website to be formatted accordingly.\n\n\n  * Cookie\nBIGipServer*\n  * Duration\nsession\n  * Description\nMarketo sets this cookie to collect information about the user's online activity and build a profile about their interests to provide advertisements relevant to the user. \n\n\n  * Cookie\n__cfruid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to identify trusted web traffic.\n\n\n  * Cookie\n_GRECAPTCHA\n  * Duration\n6 months\n  * Description\nGoogle Recaptcha service sets this cookie to identify bots to protect the website against malicious spam attacks.\n\n\n  * Cookie\n__Secure-YNID\n  * Duration\n6 months\n  * Description\nGoogle cookie used to protect user security and prevent fraud, especially during the login process.\n\n\n  * Cookie\ncookieyes-consent\n  * Duration\n1 year\n  * Description\nCookieYes sets this cookie to remember users' consent preferences so that their preferences are respected on subsequent visits to this site. It does not collect or store any personal information about the site visitors.\n\n\nFunctional\nFunctional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.\n  * Cookie\nlidc\n  * Duration\n1 day\n  * Description\nLinkedIn sets the lidc cookie to facilitate data center selection.\n\n\n  * Cookie\nbrw\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nbrwConsent\n  * Duration\n5 minutes\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nWMF-Uniq\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nloom_anon_comment\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nloom_referral_video\n  * Duration\nsession\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nVISITOR_INFO1_LIVE\n  * Duration\n6 months\n  * Description\nA cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.\n\n\n  * Cookie\nyt-remote-connected-devices\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nytidb::LAST_RESULT_ENTRY_KEY\n  * Duration\nNever Expires\n  * Description\nThe cookie ytidb::LAST_RESULT_ENTRY_KEY is used by YouTube to store the last search result entry that was clicked by the user. This information is used to improve the user experience by providing more relevant search results in the future.\n\n\n  * Cookie\nyt-remote-device-id\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-name\n  * Duration\nsession\n  * Description\nThe yt-remote-session-name cookie is used by YouTube to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\nyt-remote-fast-check-period\n  * Duration\nsession\n  * Description\nThe yt-remote-fast-check-period cookie is used by YouTube to store the user's video player preferences for embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-app\n  * Duration\nsession\n  * Description\nThe yt-remote-session-app cookie is used by YouTube to store user preferences and information about the interface of the embedded YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-available\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-available cookie is used to store the user's preferences regarding whether casting is available on their YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-installed\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-installed cookie is used to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\ncp_session\n  * Duration\n3 months\n  * Description\nCodepen sets this cookie for Help systems found in the website.\n\n\n  * Cookie\nloid\n  * Duration\n1 year 1 month 4 days\n  * Description\nThis cookie is set by the Reddit. The cookie enables the sharing of content from the website onto the social media platform.\n\n\nAnalytics\nAnalytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.\n  * Cookie\n__hstc\n  * Duration\n6 months\n  * Description\nHubspot set this main cookie for tracking visitors. It contains the domain, initial timestamp (first visit), last timestamp (last visit), current timestamp (this visit), and session number (increments for each subsequent session).\n\n\n  * Cookie\nhubspotutk\n  * Duration\n6 months\n  * Description\nHubSpot sets this cookie to keep track of the visitors to the website. This cookie is passed to HubSpot on form submission and used when deduplicating contacts.\n\n\n  * Cookie\n_ga\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors.\n\n\n  * Cookie\n_ga_*\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to store and count page views.\n\n\n  * Cookie\n__Host-psifi.analyticsTrace\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n__Host-psifi.analyticsTraceV2\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n_gh_sess\n  * Duration\nsession\n  * Description\nGitHub sets this cookie for temporary application and framework state between pages like what step the user is on in a multiple step form.\n\n\n  * Cookie\nYSC\n  * Duration\nsession\n  * Description\nYSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.\n\n\n  * Cookie\najs_anonymous_id\n  * Duration\n1 year\n  * Description\nThis cookie is set by Segment to count the number of people who visit a certain site by tracking if they have visited before.\n\n\n  * Cookie\nvuid\n  * Duration\n1 year 1 month 4 days\n  * Description\nVimeo installs this cookie to collect tracking information by setting a unique ID to embed videos on the website. \n\n\nPerformance\nPerformance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.\n  * Cookie\nAWSALB\n  * Duration\n7 days\n  * Description\nAWSALB is an application load balancer cookie set by Amazon Web Services to map the session to the target.\n\n\n  * Cookie\nacq\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nacq.sig\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nptc\n  * Duration\n2 years\n  * Description\nNo description available.\n\n\nAdvertisement\nAdvertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.\n  * Cookie\nmuc_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to collect user behaviour and interaction data to optimize the website.\n\n\n  * Cookie\nguest_id_marketing\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\nguest_id_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\npersonalization_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to integrate and share features for social media and also store information about how the user uses the website, for tracking and targeting.\n\n\n  * Cookie\nguest_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor. It registers if a user is signed in to the Twitter platform and collects information about ad preferences.\n\n\n  * Cookie\nbcookie\n  * Duration\n1 year\n  * Description\nLinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognize browser IDs.\n\n\n  * Cookie\n__Secure-ROLLOUT_TOKEN\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to manage feature rollout and experimentation. It helps Google control which new features or interface changes are shown to users as part of testing and staged rollouts, ensuring consistent experience for a given user during an experiment.\n\n\n  * Cookie\nyt.innertube::nextId\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nyt.innertube::requests\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nsession_tracker\n  * Duration\nsession\n  * Description\nThis cookie is set by the Reddit. This cookie is used to identify trusted web traffic. It also helps in adverstising on the website.\n\n\n  * Cookie\nedgebucket\n  * Duration\nsession\n  * Description\nReddit sets this cookie to save the information about a log-on Reddit user, for the purpose of advertisement recommendations and updating the content.\n\n\n  * Cookie\ndid\n  * Duration\n1 year\n  * Description\nArbor sets this cookie to show targeted ads to site visitors.This cookie expires after 2 months or 1 year.\n\n\nUncategorised\nOther uncategorised cookies are those that are being analysed and have not been classified into a category as yet.\nNo cookies to display.\nReject All Save My Preferences Accept All\nToggle Search[](https://towardsdatascience.com/)Toggle Mobile Navigation\n[](https://towardsdatascience.com/)\nPublish AI, ML & data-science insights to a global community of data professionals.\nSign in[Submit an Article](https://write.insightmediagroup.io)\n[Latest](https://towardsdatascience.com/latest/)[Editor's Picks](https://towardsdatascience.com/tag/editors-pick/)[Newsletter](https://towardsdatascience.com/tag/the-variable/)[ShipAI](https://towardsdatascience.com/shipai/)\n* * *\n[Write For TDS](https://towardsdatascience.com/submissions/)\n[LinkedIn](https://www.linkedin.com/company/towards-data-science/)[X](https://x.com/TDataScience)Toggle Search\n[Data Science](https://towardsdatascience.com/category/data-science/)\n# Beyond the Flat Table: Building an Enterprise-Grade Financial Model in Power BI\nA step-by-step journey through data transformation, star schema modeling, and DAX variance analysis with lessons learned along the way.\n[Ibrahim Salami](https://towardsdatascience.com/author/ibrahim.salami/)\nJanuary 10, 202610 min read\n![](https://assets.insightmediagroup.io/media/wp-content/uploads/2026/01/data-modeling-img-1.jpg)\nCreated with Gemini\nWe’ve all been there: You open Power BI, drag a messy Excel sheet into the canvas, and start dropping charts until something looks “right.” It’s easy, it’s intuitive, and honestly, that’s why Power BI is one of my favourite tools for data visualisation.\nBut as the world of data shifts toward end-to-end solutions like **Microsoft Fabric** , “just making it work” isn’t enough anymore. Large organisations need models that are performant, secure, and scalable.\nI’ve decided to challenge myself by taking the PL-300: Microsoft Data Analyst Associate exam. But instead of just grinding through practice tests or memorising definitions, I’m going into **“Practical Mode.”** If I’m going to get certified, I want to prove I can solve the problems real businesses actually face.\n## The Mission: The Enterprise-Grade Financial Suite\nFor my first project, I’m tackling the **Executive Financial Health Suite**.\nLearn this step by step with the interactive [AI and Data Scientist](https://roadmap.sh/ai-data-scientist) roadmap.\nWhy finance? Because in the enterprise world, it’s the ultimate test of your **Data Modeling** and **DAX** skills. Most “generic” tutorials use a single, flat table. But in a real company, data is fragmented. You have “Actuals” (what happened) sitting in one place and “Budgets” (the goal) sitting in another, usually at different levels of detail.\nIn this project, I’m going to document how I:\n  * **Deconstruct a “Flat Table”** into a clean, professional Star Schema.\n  * **Handle the “Grain” Problem** (comparing daily sales vs. monthly budgets).\n  * **Master DAX** for those high-stakes metrics like Year-to-Date (YTD) and Variance %.\n\n\nI’m sharing my journey in public so that if you’re also preparing for the PL-300, you can follow along, build these solutions with me, and understand the _why_ behind the architecture — not just the _how_.  \nFor this project, we are using the **Microsoft Financial Sample**. It’s the perfect “blank canvas” because it comes as a flat, “messy” table that we have to re-engineer professionally.\n> **How to get it:** In Power BI Desktop, go to **Home > Sample Dataset > Load Sample Data**. Select the **financials** table.\nLet’s get our hands dirty in Power Query.\n## Phase 1: Data Transformation (Power Query)\nBefore touching DAX or visuals, I slowed myself down and spent real time in **Power Query**. This is the part I used to rush through. Now I treat it as the foundation of everything that follows.  \nIf the data model is shaky, no amount of clever DAX will save you.\n### Step 1: Data Profiling (a quick reality check)\nOnce I loaded the Microsoft Financial Sample dataset, the first thing I did was **turn on column profiling** :\n  * Column quality\n  * Column distribution\n  * Column profile\n\n\nWhen I turn on **Column quality, distribution, and profile** , I’m not trying to be thorough for the sake of it. I’m scanning for **model-breaking issues** _before_ they turn into DAX headaches.\nColumn profiling immediately tells you:\n  * Where nulls are hiding\n  * Which columns are pretending to be dimensions\n  * Which fields _look_ numeric but behave like text\n\n\n**1. Nulls & Data Type Mismatches**\nI think we’re good. Empty values are 0% all through, valid are 100%, and errors are 0%. Data types are all good, also. Probably because we’re using the sample financials dataset, there shouldn’t be any issues\n**2. Cardinality: What Wants to Be a Dimension**\nCardinality is simply **how many unique values a column has**. Power BI surfaces this immediately in **Column distribution** , and once you start paying attention to it, modeling decisions get much easier.\nHere’s my rule of thumb:\n  * **Low cardinality** (values repeat a lot) → likely a dimension\n  * **High cardinality** (values are mostly unique) → fact-level detail\n\n\nWhen I turn on column distribution, I’m asking two questions:\n  * _How many distinct values does this column have?_\n  * _Do those values repeat enough to be useful for filtering or grouping?_\n\n\nIf a column looks categorical but has thousands of distinct values, that’s a red flag.\nOnce I turned on **Column distribution** , the dataset started sorting itself for me.\nSome columns immediately showed **low cardinality** — they repeated often and behaved like true categories:\n  * Segment\n  * Country\n  * Product\n  * Discount Band\n  * Manufacturing Price\n  * Sales Price\n  * Date attributes (Year, Month Number, Month Name)\n\n\nThese columns had relatively few distinct values and clear repetition across rows. That’s a strong signal: _these want to be used for grouping, slicing, and relationships_. In other words, they naturally belong on the **dimension side** of a star schema.\nThen there were the columns on the other end of the spectrum.\nMeasures like:\n  * Units Sold\n  * Gross Sales\n  * Discounts\n  * Sales\n  * COGS\n  * Profit\n\n\n...showed **very high cardinality**. Many values were unique or nearly unique per row, with wide numeric ranges. That’s exactly what I expect from **fact-level metrics** — they’re meant to be aggregated, not filtered on.\nThat insight directly informed my next step: using **Reference** in Power Query to spin off `Dim_Product` and `Dim_Geography`, instead of guessing or forcing the structure.\n### Step 2: Spinning Dimensions with Reference (Not Duplicate)\nThis is the point where I stopped treating the dataset as a report-ready table and started treating it as a **model-in-progress**.  \nIn Power Query, it’s tempting to right-click a table and hit **Duplicate**. I used to do that all the time. It works — but it quietly creates problems you only feel later.\nInstead, I used **Reference**.  \nWhy reference instead of duplicate? You might ask\nWhen you create a referenced table:\n  * It inherits all upstream transformations\n  * It stays logically tied to the source\n  * Any fix in the fact table automatically flows downstream\n\n\nFrom a real-world perspective, it’s just… safer.\nHere’s how I created `Dim_Product & Dim_Geography`\nStarting from the main financial table:\n  * I right-clicked the query and selected **Reference**\n  * Renamed the new query to `Dim_Product`\n  * Kept only product-related columns (Product, Segment, Discount Band)\n  * Removed duplicates\n  * Ensured clean data types and naming\n\n\nWhat I ended up with was a small, stable table with **low cardinality** — perfect for slicing and grouping.\nI repeated the same approach for geography:\n  * Reference the fact table\n  * Keep the Country column\n  * Remove duplicates\n  * Clean text values\n\n\n> P.S. In this dataset, geography is represented only at the country level. Rather than forcing a region or city hierarchy that doesn’t exist, I modeled Country as a lean, single-column dimension.\n### Step 3: Create a Dynamic Date Table\nHere’s where I see a lot of Power BI models quietly fail PL-300 standards.\n  * I didn’t import a static calendar.\n  * I didn’t manually generate dates.\n  * I built a **dynamic date table in Power Query** based on the data itself.\n\n\nWhy this matters:\n  * It guarantees **no missing dates**\n  * It automatically adjusts when new data arrives\n  * It aligns perfectly with Microsoft’s modeling best practices\n\n\n> To create a dynamic date table. Just click on **Load - > Blank Query -> Advanced Editor** and paste this code in\nBelow is the exact **M code** I used\npowerquery\n\n```\nlet\nSource = Financials,\nMinDate = Date.From(List.Min(Source[Date])),\nMaxDate = Date.From(List.Max(Source[Date])),\nDateList = List.Dates(\nMinDate,\nDuration.Days(MaxDate — MinDate) + 1,\n#duration(1, 0, 0, 0)\n),\nDateTable = Table.FromList(DateList, Splitter.SplitByNothing(), {“Date”}),\nAddYear = Table.AddColumn(DateTable, “Year”, each Date.Year([Date]), Int64.Type),\nAddMonthNum = Table.AddColumn(AddYear, “Month Number”, each Date.Month([Date]), Int64.Type),\nAddMonthName = Table.AddColumn(AddMonthNum, “Month Name”, each Date.MonthName([Date]), type text),\nAddQuarter = Table.AddColumn(AddMonthName, “Quarter”, each “Q” & Number.ToText(Date.QuarterOfYear([Date])), type text),\nAddDay = Table.AddColumn(AddQuarter, “Day”, each Date.Day([Date]), Int64.Type)\nin\nAddDay\n```\n\nThis calendar:\n  * Covers **every date** in the dataset\n  * Scales automatically\n  * Is ready for time intelligence the moment it hits the model\n\n\nOnce loaded, I marked it as a **Date Table** in the model view — non-negotiable for PL-300.\nBy the end of Phase 1, I had:\n  * A clean fact table\n  * Proper dimension tables created via **Reference**\n  * A dynamic, gap-free date table\n  * Transformations I could actually explain to another analyst\n\n\nNothing flashy yet — but this is the phase that makes everything _after_ it easier, faster, and more reliable.\nIn the next section, I’ll move into **data modeling and relationships** , where this structure really starts paying dividends.\n## Phase 2: Data Modeling (From Tables to a Star Schema)\nThis is the phase where Power BI starts behaving like a **semantic model**.\nBy the time I switched to the **Model view** , I already had:\n  * A clean fact table\n  * Lean dimensions created via _Reference_\n  * A dynamic, gap-free date table\n\n\nNow the goal was simple: **connect everything cleanly and intentionally**.\n### Step 1: Establishing the Star Schema\nI aimed for a classic **star schema** :\n  * One central fact table (financial metrics)\n  * Surrounding dimension tables (`Dim_Date`, `Dim_Product`, `Dim_Geography`)\n\n\n  \nEvery relationship needed to answer three questions:\n  * Which table is the “one” side?\n  * Which table is the “many” side?\n  * Does this relationship make sense at the grain of the data?\n\n\nYou might notice that I didn’t introduce surrogate keys for the fact or dimension tables. In this dataset, the natural keys — Country, Product, and Date — are stable, low-cardinality, and unambiguous. For this model, adding artificial IDs would increase complexity without improving clarity or performance.\nHere’s how the overall model looks:\n![](https://assets.insightmediagroup.io/media/wp-content/uploads/2026/01/model-view-1024x485.png)\n### Step 2: Relationship Direction (Single, on Purpose)\nAll relationships were set to:\n  * **Many-to-one**\n  * **Single direction** , flowing from dimension → fact\n\n\nFor PL-300 and real-world models alike, **single-direction filters are the default** until there’s a strong reason not to use them.\n### Step 3: Date Table as the Anchor\nThe dynamic date table I created earlier now became the **backbone** of the model.\nI:\n  * Related `Dim_Date[Date]` to the fact table’s date column\n  * Marked `Dim_Date` as the official Date Table\n  * Hid the raw date column in the fact table\n\n\nThis does three important things:\n  * Enables time intelligence\n  * Prevents accidental use of the wrong date field\n  * Forces consistency across measures\n\n\nFrom here on out, every time-based calculation flows through this table — no exceptions.\n### Step 4: Hiding What Users Don’t Need\nThis is a small step with an outsized impact. PL-300 explicitly tests this idea that the model shouldn't be just correct — it should be **usable**.\nI hid:\n  * Foreign keys (Date, Product, Country). If a column exists only to create relationships, it doesn’t need to appear in the Fields pane.\n  * Raw numeric columns that should only be used in measures. After creating my DAX measures (e.g. Total Sales, Total Profit). I can go ahead and hide raw numeric columns (like Units Sold, Gross Sales, Discounts, Sales, COGS, Profit) from my fact table. These nudges users toward correct and consistent aggregations\n  * Duplicate date attributes in the fact Table (Year, Month, Month Number). These already exist in the date table.\n\n\n### Step 5: Validating the Model (Before Writing DAX)\nBefore touching any measures, I did a quick sanity check:\n  * Does slicing by Country behave correctly?\n  * Do Product and Segment filter as expected?\n  * Do dates aggregate cleanly by Year and Month?\n\n\nIf something breaks here, it’s a modeling issue — not a DAX issue.\nTo test this, I created a quick visual checking the Sum of Profit by Year. Here’s how it turned out:\n![](https://assets.insightmediagroup.io/media/wp-content/uploads/2026/01/sum-of-profit.png)\nSo far so good! Now we can move on to creating our DAX measures.\n## Phase 3: DAX Measures & Variance Analysis (Where the Model Starts to Shine)\nThis is the phase where the work I’d done in Power Query and the model really started paying off. Honestly, it’s the first time in a while that writing DAX _didn’t feel like fighting the table_. The star schema made everything… predictable.\n### Step 1: Base Measures — the foundation of sanity\nI resisted my old instinct to drag raw columns into visuals. Instead, I created explicit measures for everything I cared about:\npowerquery\n\n```\nTotal Sales :=\nSUM ( financials[ Sales])\n\nTotal Profit :=\nSUM ( financials[Profit] )\n\nTotal Units Sold :=\nSUM ( financials[Units Sold] )\n\nTotal COGS :=\nSUM ( financials[COGS])\n```\n\n### Step 2: Time intelligence without surprises\nBecause I already had a complete, properly marked date table, things like year-to-date or prior year comparisons were effortless.\n**Sales Year-to-Date**\npowerquery\n\n```\nSales YTD :=\nTOTALYTD (\n[Total Sales],\n‘Dim_Date’[Date]\n)\n```\n\n**Sales Prior Year**\npowerquery\n\n```\nSales PY :=\nCALCULATE (\n[Total Sales],\nSAMEPERIODLASTYEAR ( ‘Dim_Date’[Date] )\n)\n```\n\n### Step 3: Variance measures — turning numbers into insight\nOnce I had Actual vs Prior Period, I could calculate variance with almost no extra effort:\npowerquery\n\n```\nSales YoY Variance :=\n[Total Sales] — [Sales PY]\n\nSales YoY % :=\nDIVIDE (\n[Sales YoY Variance],\n[Sales PY]\n)\n```\n\nSame approach for month-over-month:\npowerquery\n\n```\nSales PM :=\nCALCULATE (\n[Total Sales],\nDATEADD ( 'Dim_Date'[Date], -1, MONTH )\n)\n\nSales MoM Variance :=\n[Total Sales] - [Sales PM]\n\nSales MoM % :=\nDIVIDE (\n[Sales MoM Variance],\n[Sales PM]\n)\n```\n\n### Step 4: Why this actually feels “easy”\nHere’s the honest part: writing DAX didn’t feel like the hardest thing. The hard part was everything that came _before_ :\n  * Cleaning the data\n  * Profiling columns\n  * Spinning out dimensions with Reference\n  * Building a solid date table\n\n\nBy the time I got here, the DAX was just **adding value** instead of patching holes.\n> Good DAX isn’t clever — it’s predictable, trustworthy, and easy to explain.\n## Conclusion\nThe magic wasn’t in any single DAX formula — it was in how the model came together. By profiling the data early, understanding cardinality, and spinning dimensions with **Reference** , I built a structure that just works. A dynamic date table and clean relationships meant time intelligence measures and variance calculations ran effortlessly.\nHiding unnecessary fields and grouping measures thoughtfully made the model approachable, even for someone else exploring it for the first time. By the time I wrote the DAX for Actual vs. Prior Period or Month-over-Month variance, everything felt predictable and trustworthy.\nIf you want to see the full semantic model in action, including all the tables, relationships, and measures, you can **download it**[**here**](https://github.com/ibbysalam/Enterprise-Grade-Financial-Model-in-Power-BI) and explore how it ties together. There’s no better way to learn than seeing a working model in Power BI and experimenting with it yourself.\nWanna connect? Feel free to say hi on any of the platforms below\n[Medium](https://medium.com/@ibbysalam)\n[LinkedIn](https://www.linkedin.com/in/ibrahim-salami-059863228/)\n[Twitter](https://x.com/IbbySalam)\n[YouTube](https://www.youtube.com/@ibbysalam)\n## Register Now to Continue Reading\n### Unlock Towards Data Science with a Free Account\nAll articles on Towards Data Science are available to registered users. Create a free account today to access this article and thousands more.\nRegister for freeSign in to your account\n* * *\n![](https://assets.insightmediagroup.io/media/1787657709013_9ddcph.jpeg)\nWritten By\n## [Ibrahim Salami](https://towardsdatascience.com/author/ibrahim.salami/)\n[See all from Ibrahim Salami](https://towardsdatascience.com/author/ibrahim.salami/)\n[Busines Intelligence](https://towardsdatascience.com/tag/busines-intelligence/)[Data Analytics](https://towardsdatascience.com/tag/data-analytics/)[Data Modeling](https://towardsdatascience.com/tag/data-modeling/)[Data Visualization](https://towardsdatascience.com/tag/data-visualization/)[Power Bi](https://towardsdatascience.com/tag/power-bi/)\nShare This Article\n  * [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ftowardsdatascience.com%2Fbeyond-the-flat-table-building-an-enterprise-grade-financial-model-in-power-bi%2F&title=Beyond%20the%20Flat%20Table%3A%20Building%20an%20Enterprise-Grade%20Financial%20Model%20in%20Power%C2%A0BI)\n  * [](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Ftowardsdatascience.com%2Fbeyond-the-flat-table-building-an-enterprise-grade-financial-model-in-power-bi%2F&title=Beyond%20the%20Flat%20Table%3A%20Building%20an%20Enterprise-Grade%20Financial%20Model%20in%20Power%C2%A0BI)\n  * [](https://x.com/share?url=https%3A%2F%2Ftowardsdatascience.com%2Fbeyond-the-flat-table-building-an-enterprise-grade-financial-model-in-power-bi%2F&text=Beyond%20the%20Flat%20Table%3A%20Building%20an%20Enterprise-Grade%20Financial%20Model%20in%20Power%C2%A0BI)\n\n\nTowards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program.\n[Write for TDS](https://towardsdatascience.com/submissions/)\n## Related Articles\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/04/06CuN2zDFni6PWO48-scaled.jpg)](https://towardsdatascience.com/sql-to-sarimax-how-i-navigate-the-first-time-series-analysis-personal-project-for-my-portfolio-1ed24cba2c52/)\n## [SQL to SARIMAX: How I navigate the first time-series analysis personal project for my portfolio](https://towardsdatascience.com/sql-to-sarimax-how-i-navigate-the-first-time-series-analysis-personal-project-for-my-portfolio-1ed24cba2c52/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nIncluding the resources I used to learn time-series as I was doing this project (MySQL, ARIMA orders selection, parallelization in Jupyter...\n[Irene Chang](https://towardsdatascience.com/author/irenechang1510/)\nApril 6, 202210 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/09/1cwQIyGU5IAj_qE_oI99VmA-scaled.jpeg)](https://towardsdatascience.com/data-stacks-for-fun-nonprofit-part-ii-d375d824abf3/)\n## [Data Stacks For Fun & Nonprofit - Part II](https://towardsdatascience.com/data-stacks-for-fun-nonprofit-part-ii-d375d824abf3/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nDesigning a complete data stack with Meltano, DBT and Superset.\n[Andrew Stewart](https://towardsdatascience.com/author/andrewcstewart/)\nSeptember 27, 202011 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2023/01/106_gnx0LG7FtCrMwsHN61A.jpeg)](https://towardsdatascience.com/ethics-in-ai-potential-root-causes-for-biased-algorithms-890091915aa3/)\n## [Ethics in AI: Potential Root Causes for Biased Algorithms](https://towardsdatascience.com/ethics-in-ai-potential-root-causes-for-biased-algorithms-890091915aa3/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nAn alternative approach to understanding bias in data\n[Jonas Dieckmann](https://towardsdatascience.com/author/jonas_dieckmann/)\nJanuary 27, 202310 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/11/06wUi0Z64ycxKZJWv-scaled.jpg)](https://towardsdatascience.com/the-price-is-too-damn-high-part-1-9b32e13a8b3/)\n## [The Price is Too Damn High: Part 1](https://towardsdatascience.com/the-price-is-too-damn-high-part-1-9b32e13a8b3/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nA look at submitted Medicare charges by state in 2017 and 2012\n[Anne Bode](https://towardsdatascience.com/author/annebode/)\nNovember 19, 202013 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/02/1GsPbxBnMpzb-A1IX3k3FkA.png)](https://towardsdatascience.com/analysis-with-pandas-matplotlib-and-folium-spanish-courses-for-foreigners-in-the-municipal-31e93fb3656f/)\n## [Analysis with Pandas, Matplotlib, and Folium -Spanish courses for foreigners in the Municipal...](https://towardsdatascience.com/analysis-with-pandas-matplotlib-and-folium-spanish-courses-for-foreigners-in-the-municipal-31e93fb3656f/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nSide-by-side bar charts, stacked bar plots, pie plots, and cloropleth maps\n[Amanda Iglesias Moreno](https://towardsdatascience.com/author/amandaiglesiasmoreno/)\nFebruary 5, 20204 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/08/1-nY38NpN537Gyw0rXku49A.jpeg)](https://towardsdatascience.com/20-numpy-operations-that-every-data-scientist-should-know-fb44bb52bde5/)\n## [20 NumPy Operations That Every Data Scientist Should Know](https://towardsdatascience.com/20-numpy-operations-that-every-data-scientist-should-know-fb44bb52bde5/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nNumPy forms the basis of many Python libraries in the data science domain.\n[Soner Yıldırım](https://towardsdatascience.com/author/sonery/)\nAugust 29, 20205 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/05/1NyT2xZPFl98ymTOZjLQE9A-scaled.jpeg)](https://towardsdatascience.com/data-analysts-primer-to-slowly-changing-dimensions-d087c8327e08/)\n## [Data Analyst's Primer to Slowly Changing Dimensions](https://towardsdatascience.com/data-analysts-primer-to-slowly-changing-dimensions-d087c8327e08/)\n[](https://towardsdatascience.com/beyond-the-flat-table-building-an-enterprise-grade-financial-model-in-power-bi/)\nData Analyst interviews will typically entail both technical and behavioral components.\n[Nick Vega](https://towardsdatascience.com/author/nvega-1989/)\nApril 25, 20218 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/05/1cDyZZf2Vgq0RTr5MRFGSNg.jpeg)](https://towardsdatascience.com/aesthetic-epistemology-a-review-of-erna-fiorentinis-inducing-visibilities-3d61919593c3/)\n## [Aesthetic Epistemology: A Review of Erna Fiorentini's\"Inducing Visibilities...\"](https://towardsdatascience.com/aesthetic-epistemology-a-review-of-erna-fiorentinis-inducing-visibilities-3d61919593c3/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nA Brief Review of \"Inducing visibilities: An attempt at Santiago Ramón y Cajal's aesthetic epistemology\"...\n[Jesse Ruiz (she/they)](https://towardsdatascience.com/author/jjr8888/)\nMay 24, 20213 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2024/07/17hqh82aY9fjLYCwJtf16nA@2x.jpeg)](https://towardsdatascience.com/product-quasi-experimentation-statistical-techniques-when-standard-a-b-testing-is-not-possible-68d516a59b1c/)\n## [Product Quasi-Experimentation: Statistical Techniques When Standard A/B Testing Is Not Possible](https://towardsdatascience.com/product-quasi-experimentation-statistical-techniques-when-standard-a-b-testing-is-not-possible-68d516a59b1c/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nA guide to the most popular techniques when randomized A/B testing is not possible\n[Magda Ntetsika](https://towardsdatascience.com/author/ntetsika.magda/)\nJuly 19, 20246 min read\n\n\n  * [YouTube](https://www.youtube.com/c/TowardsDataScience)\n  * [X](https://x.com/TDataScience)\n  * [LinkedIn](https://www.linkedin.com/company/towards-data-science/)\n  * [Threads](https://www.threads.net/@towardsdatascience)\n  * [Bluesky](https://bsky.app/profile/towardsdatascience.com)\n\n\n[](https://towardsdatascience.com/)\nYour home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.\nSubscribe to Our Newsletter[Write For TDS](https://towardsdatascience.com/submissions/)•[About](https://towardsdatascience.com/about-towards-data-science-d691af11cc2f/)•[Advertise](https://contact.towardsdatascience.com/advertise-with-towards-data-science)•[Privacy Policy](https://towardsdatascience.com/privacy-policy/)•[Terms of Use](https://towardsdatascience.com/website-terms-of-use/)\n© Insight Media Group, LLC 2026•[The New Stack](https://thenewstack.io)•[roadmap.sh](https://roadmap.sh)•[Creator Network](https://insightmediagroup.io/creator-network)\n####  Recommended Articles \nClose\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500) Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1 ](https://towardsdatascience.com/javascript-fatigue-you-dont-need-js-to-build-chatgpt/ \"Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500) The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs ](https://towardsdatascience.com/subset-sum-problem-solved-in-linear-time-for-dense-enough-inputs/ \"The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500) Does Your Company Have a Data Strategy? ](https://towardsdatascience.com/does-your-company-have-a-data-strategy-e8944dbec4ae/ \"Does Your Company Have a Data Strategy?\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/4970/image?etag=1780565225463&width=500&height=500) Productivity Tips, Data Career Insights, and Other Recent Must-Reads ](https://towardsdatascience.com/productivity-tips-data-career-insights-and-other-recent-must-reads-5c47eb7a2fe0/ \"Productivity Tips, Data Career Insights, and Other Recent Must-Reads\")\n\n\n",
  "body_base_path": "attachments/c90ea54c6ed8/pages/",
  "body_markdown_path": "attachments/c90ea54c6ed8/pages/archived-body.md",
  "local_html": "attachments/c90ea54c6ed8/pages/archived-body.html",
  "body_source": "prior_capture"
}