How to Find Mode in Power BI
Finding the most common or frequently occurring value in a dataset is a common task in data analysis, but it can be surprisingly tricky if you’re coming to Power BI from an Excel background. This article will show you a few straightforward methods to calculate the mode in Power BI, whether you prefer using a quick visual trick or writing a powerful DAX measure.
So, What Is the Mode, Anyway?
Before we jump into Power BI, let's have a quick refresher. In a set of data, the mode is simply the value that appears most often. Unlike the mean (the average) or the median (the middle value), the mode is all about frequency.
Think about a dataset of t-shirt sales. The mode would tell you the most popular size sold (e.g., Large). If you run a retail store, the mode of products sold tells you your bestseller. It’s useful for understanding popular choices, common categories, or recurring events.
- Mean (Average): Sum of all values / Count of all values.
- Median: The middle value when all numbers are sorted.
- Mode: The most frequently occurring value. A dataset can have one mode, more than one mode (multimodal), or no mode at all.
Wait, Power BI Doesn't Have a MODE Function?
Here’s the first hurdle many newcomers face: if you type MODE() into a DAX formula bar, you’ll get an error. Unlike Excel’s handy MODE.SNGL() and MODE.MULT() functions, Power BI doesn’t have a built-in, one-click DAX function to calculate this for you.
But don't worry. This doesn't mean it's impossible - far from it. It just means we need to tell Power BI how to find it. We'll explore two primary ways to do this: the visual "easy button" method and the more powerful (and reusable) DAX method.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Method 1: Find the Mode Visually (The No-Code Approach)
The fastest and simplest way to find the mode doesn't involve any code. You can use Power BI’s own visuals to spot the most frequent value in seconds. This is perfect for quick analysis or displaying the bestseller in a report.
Let's find the most popular product category from a sample Sales table.
- Create a Bar Chart or Column Chart
- Add Your Data
- Sort the Chart
Voilà! The top bar on your chart is your mode. In this case, "Accessories" is the most frequently sold product category. This method is incredibly fast, easy to understand, and great for direct inclusion in a dashboard.
The only downside is that you can't reuse this "result" in other calculations. It’s a visual representation, not a calculated value. For that, you’ll need DAX.
Method 2: Using DAX to Calculate the Mode
If you need to use the mode in other measures or display it in a KPI card, you'll need to write a DAX formula. We'll build a measure that first counts how many times each item appears and then identifies which item has the highest count.
Calculating a Single Mode Value
This formula works perfectly for datasets where you expect one clear winner (or you're okay with DAX picking one in case of a tie). It’s ideal for finding the single most frequent value.
The Core Logic: The idea is to rank all the unique values in your column by their count, from highest to lowest. Then, we just need to grab the top one.
In your Sales table, let's create a new measure. Click "New measure" from the Home or Modeling tab and enter this DAX code:
Most Frequent Product Category = CALCULATE( VALUES(Sales[Product Category]), TOPN( 1, ALL(Sales[Product Category]), COUNTROWS(Sales) ) )
DAX Formula Breakdown:
Let's walk through this formula from the inside out to understand what it's doing.
COUNTROWS(Sales): Within our current context, this counts the number of rows for each product category.ALL(Sales[Product Category]): This returns a table of all the unique product categories, ignoring any filters currently applied in the report. This is important to ensure we're looking at all categories to find the true winner.TOPN(1, ..., ...): This is the star of the show. It’s a table function that returns the top N rows from a table. Here, we're asking for thetop 1row from our list of all product categories, ordering them by theCOUNTROWScalculation in descending order (descending is the default forTOPN). In essence, it finds the product category with the highest row count.CALCULATE(VALUES(Sales[Product Category]), ...): Finally,CALCULATEmodifies the context. TheTOPNfunction returns a table (even if it's just one row). We just want the text value from that table.VALUES(Sales[Product Category])extracts that single text value ("Accessories") so we can display it.
Once you create the measure, you can drag it into a card visual to display your mode proudly: "Accessories."
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Handling Multiple Modes (Multimodal Data)
What if you have a tie? For example, what if "Accessories" and "Tires" have the exact same number of sales? The DAX formula above will only return one of them (usually the one that comes first alphabetically).
If you want to display all winning values, we need a slightly more advanced formula using CONCATENATEX. This will combine all mode values into a single text string, separated by a comma.
Create a new measure with this DAX:
Modes (All Frequent Categories) = VAR CategoryCounts = ADDCOLUMNS( VALUES(Sales[Product Category]), "Count", CALCULATE(COUNTROWS(Sales)) ) VAR MaxCount = MAXX(CategoryCounts, [Count]) VAR ModesTable = FILTER(CategoryCounts, [Count] = MaxCount) RETURN CONCATENATEX(ModesTable, [Product Category], ", ")
DAX Formula Breakdown:
Let's understand this step-by-step.
VAR CategoryCounts = ...: First, we create a variable that represents a temporary table.ADDCOLUMNSadds a new column named "Count" to a table of unique categories (VALUES(Sales[Product Category])), where each value in the "Count" column is the row count for that category.VAR MaxCount = MAXX(...):Next, we find the highest value in our new "Count" column. This gives us the frequency number of our mode(s).VAR ModesTable = FILTER(...): We then filter ourCategoryCountstable to only include rows where the "Count" is equal to theMaxCountwe just found. If there's a tie, this table will contain multiple rows.RETURN CONCATENATEX(...): Finally,CONCATENATEXgoes through theModesTablerow by row, takes the value from theProduct Categorycolumn, and joins them all into a single text string, separated by ", ".
Now, if "Accessories" and "Tires" were both bestsellers, a card with this measure would display: "Accessories, Tires".
Final Thoughts
While Power BI doesn’t offer a simple MODE() function, finding the most frequent value is very achievable. You can quickly spot it using a bar chart for visual reporting or write a powerful DAX measure with TOPN or CONCATENATEX to calculate and reuse the result in your data model.
We know that navigating DAX and data prep can be time-consuming, which is why we built our platform to handle this complexity for you. Instead of writing formulas to track performance, with Graphed you simply connect your data sources (like Shopify, Google Analytics, etc.) and ask questions like, "What was our bestseller last month?" Graphed automatically generates a real-time dashboard, giving you instant answers so you can focus on strategy, not syntax.
Related Articles
Facebook Ads for Real Estate Agents: The Complete 2026 Strategy Guide
Master Facebook ads for real estate agents in 2026. Learn targeting, ad formats, budgets, and creative best practices to generate more leads.
Facebook Ads for Movers: The Complete 2026 Strategy Guide
Learn how to run Facebook ads for movers that actually generate booked jobs—not just clicks. Budget, targeting, funnel strategy, and creative that converts.
Facebook Ads for Web Designers: The Complete 2026 Strategy Guide
Learn how to use Facebook ads to attract high-value web design clients in 2026. A complete 7-step system for agencies and freelancers.