Finding the highest value in Power BI is pretty straightforward when I only need the overall maximum. But when I want to find the highest sale for a specific region, the latest order date for a particular product, or the product associated with the most recent order, I need to apply a filter along with MAX().
In this tutorial, I’ll show you every practical way to use DAX MAX with a filter in Power BI: CALCULATE + MAX, MAXX + FILTER, ignoring slicers with ALL / REMOVEFILTERS, finding the max per group with ALLEXCEPT, and the question I get asked most often — how to return a value from another column that corresponds to the max date.
Every example uses the same small dataset, and I’ve listed the exact result each formula returns, so you can build it yourself and check your work.
Quick answer
To get the maximum value of a column for a specific condition, wrap MAX inside CALCULATE and pass the condition as a filter:
Max Sale Electronics =
CALCULATE (
MAX ( Sales[SalesAmount] ),
Sales[Category] = "Electronics"
)
If you need the max of a calculated expression (not a single column), use MAXX over a filtered table instead:
Max Unit Price Electronics =
MAXX (
FILTER ( Sales, Sales[Category] = "Electronics" ),
DIVIDE ( Sales[SalesAmount], Sales[Quantity] )
)

The rest of this post explains when to use which, and how to handle the tricky cases.
MAX vs MAXX in DAX: what’s the difference?
Both functions return the largest value, but they work differently:
| MAX | MAXX | |
|---|---|---|
| Syntax | MAX(<column>) or MAX(<expr1>, <expr2>) | MAXX(<table>, <expression>, [<variant>]) |
| Works on | One column (or compares two scalar values) | Any expression, evaluated row by row |
| Type | Aggregator | Iterator (the “X” functions) |
| Accepts a filter directly? | No — wrap it in CALCULATE | Yes — pass FILTER(...) as the table |
| Can find the max of a measure? | No | Yes, e.g. MAXX(VALUES(Sales[Region]), [Total Sales]) |
| Blanks | Skipped in a column | Skipped |
| TRUE/FALSE values | Not supported (use MAXA) | Not supported |
Rule of thumb: if you want the max of a single column under a condition, use CALCULATE(MAX(...), condition). If you want the max of something you calculate per row, or the max of a measure across groups, use MAXX.
Sample data used in this tutorial
Create a table called Sales in Power BI Desktop (Home > Enter data) with these 10 rows. Set OrderDate to the Date type and Quantity / SalesAmount to Whole Number.
| OrderID | OrderDate | Region | Product | Category | Quantity | SalesAmount |
|---|---|---|---|---|---|---|
| 1 | 2026-01-05 | East | Laptop | Electronics | 3 | 3600 |
| 2 | 2026-01-12 | West | Phone | Electronics | 5 | 4000 |
| 3 | 2026-02-03 | East | Desk | Furniture | 2 | 900 |
| 4 | 2026-02-18 | North | Laptop | Electronics | 1 | 1200 |
| 5 | 2026-03-02 | West | Chair | Furniture | 8 | 1600 |
| 6 | 2026-03-15 | East | Phone | Electronics | 4 | 3200 |
| 7 | 2026-03-28 | North | Desk | Furniture | 3 | 1350 |
| 8 | 2026-04-06 | West | Laptop | Electronics | 2 | 2400 |
| 9 | 2026-04-20 | East | Chair | Furniture | 6 | 1200 |
| 10 | 2026-04-20 | North | Phone | Electronics | 2 | 1600 |
Notice that orders 9 and 10 share the same date (2026-04-20). That’s deliberate — ties on the max date are a common source of wrong results, and I’ll show you how to handle them in Example 9.
Also create this base measure, which a few examples use:
Total Sales = SUM ( Sales[SalesAmount] )

Example 1: Basic MAX (and how filter context already affects it)
Max Sale = MAX ( Sales[SalesAmount] )

In a table visual, this returns 4000. Now put Region in a table visual next to it:
| Region | Max Sale |
|---|---|
| East | 3600 |
| North | 1600 |
| West | 4000 |
| Total | 4000 |

This is the most important thing to understand: MAX already respects filter context. Every row of the visual, every slicer and every page filter narrows down the rows MAX can see. You only need an explicit filter when you want a condition that isn’t coming from the report — or when you want to remove one.
Example 2: Power BI MAX with one filter using CALCULATE
To get the highest sale for Electronics only:
Max Sale Electronics =
CALCULATE (
MAX ( Sales[SalesAmount] ),
Sales[Category] = "Electronics"
)
Result in a card: 4000. By region it returns East = 3600, North = 1600, West = 4000. Change the filter to “Furniture” and the card returns 1600.

Watch out: CALCULATE overrides the existing filter on that column
Put Category in the rows of a table visual with this measure and you’ll see something surprising:
| Category | Max Sale Electronics | Max Sale Electronics (KEEPFILTERS) |
|---|---|---|
| Electronics | 4000 | 4000 |
| Furniture | 4000 | (blank) |
The Furniture row shows 4000 because the filter Sales[Category] = "Electronics" replaces the Furniture filter coming from the visual. If you want the conditions to intersect instead, wrap the condition in KEEPFILTERS:
Max Sale Electronics (KEEPFILTERS) =
CALCULATE (
MAX ( Sales[SalesAmount] ),
KEEPFILTERS ( Sales[Category] = "Electronics" )
)

Example 3: MAX with multiple filters in Power BI (AND / OR)
AND conditions
Separate filters in CALCULATE with commas — they’re combined with AND:
Max Sale East Electronics =
CALCULATE (
MAX ( Sales[SalesAmount] ),
Sales[Category] = "Electronics",
Sales[Region] = "East"
)

Result: 3600 (orders 1 and 6 match; 3600 is the larger).

OR conditions on the same column
Use IN (or ||) when the values come from one column:
Max Sale East or North =
CALCULATE (
MAX ( Sales[SalesAmount] ),
Sales[Region] IN { "East", "North" }
)

Result: 3600.
OR conditions across different columns
A simple filter argument can only reference one column. For an OR across two columns, use FILTER over just those columns:
Max Sale North or Furniture =
CALCULATE (
MAX ( Sales[SalesAmount] ),
FILTER (
ALL ( Sales[Region], Sales[Category] ),
Sales[Region] = "North" || Sales[Category] = "Furniture"
)
)

Result: 1600 (the matching rows are 3, 4, 5, 7, 9 and 10).
Example 4: MAX with a “greater than” condition in Power BI
Highest sale among orders with a quantity of 3 or more:
Max Sale Qty 3+ =
CALCULATE (
MAX ( Sales[SalesAmount] ),
Sales[Quantity] >= 3
)

Result: 4000. The same pattern works with >, <, <= and <> (not equal).
Example 5: Power BI MAXX with FILTER (max of a calculated expression)
Suppose you want the highest unit price sold in Electronics. There’s no unit price column, so you have to calculate it per row — that’s a job for MAXX:
Max Unit Price Electronics =
MAXX (
FILTER ( Sales, Sales[Category] = "Electronics" ),
DIVIDE ( Sales[SalesAmount], Sales[Quantity] )
)

Result: 1200 (the Laptop). FILTER returns only the Electronics rows, and MAXX evaluates the division on each of them and keeps the highest.
Performance tip: if you only need the max of an existing column, prefer CALCULATE(MAX(col), condition) over MAXX(FILTER(Sales, ...), col). Filtering a single column is cheaper for the engine than iterating the whole table, which matters on large fact tables.
Example 6: MAX of a measure in Power BI (highest region or product total)
MAX only accepts a column, so you can’t write MAX([Total Sales]). To find the highest total across a group, iterate the group with MAXX:
Best Region Sales =
MAXX (
VALUES ( Sales[Region] ),
[Total Sales]
)
Region totals are East = 8900, West = 8000 and North = 4150, so the result is 8900. Swap Sales[Region] for Sales[Product] and you get 8800 (Phone).

To return the name of the best region instead of its value:
Best Region =
VAR RegionTotals =
ADDCOLUMNS ( VALUES ( Sales[Region] ), "@Sales", [Total Sales] )
RETURN
MAXX ( TOPN ( 1, RegionTotals, [@Sales], DESC ), Sales[Region] )

Result: East.
Example 7: Power BI MAX ignoring filters (ALL, REMOVEFILTERS, ALLSELECTED)
Sometimes you need the overall max on every row — for example, to compare each region against the best one.
Max Sale All Regions =
CALCULATE (
MAX ( Sales[SalesAmount] ),
REMOVEFILTERS ( Sales[Region] )
)
% of Max Sale =
DIVIDE ( [Max Sale], [Max Sale All Regions] )
| Region | Max Sale | Max Sale All Regions | % of Max Sale |
|---|---|---|---|
| East | 3600 | 4000 | 90% |
| North | 1600 | 4000 | 40% |
| West | 4000 | 4000 | 100% |

Which remover should you use?
- REMOVEFILTERS(Sales[Region]) /
ALL(Sales[Region])— ignores every filter on Region, including slicers. (REMOVEFILTERSis simply a more readable alias ofALLwhen used inside CALCULATE.) ALL(Sales)— ignores every filter on the whole table. The result is 4000 no matter what the user selects.ALLSELECTED(Sales[Region])— ignores the visual’s row filter but keeps slicer selections. With a Region slicer set to East and North, it returns 3600 (the best of the selected regions), whileREMOVEFILTERS(Sales[Region])still returns 4000 from West. This is usually what users expect.
Example 8: Max per group in a calculated column (ALLEXCEPT)
If you need the max per region stored on every row — for example to flag the top order in each region — use a calculated column:
Region Max Sale =
CALCULATE (
MAX ( Sales[SalesAmount] ),
ALLEXCEPT ( Sales, Sales[Region] )
)
Is Top Order in Region =
IF ( Sales[Total Sales] = Sales[Region Max Sale], "Yes", "No" )

East rows get 3600, West rows 4000, North rows 1600. Orders 1, 2 and 10 are flagged Yes. In a calculated column, CALCULATE turns the current row into a filter (context transition); ALLEXCEPT then removes every column filter except Region.
Note: Calculated columns are computed at refresh and do not react to slicers. If the “top” should change with the user’s selection, use a measure like Example 7 instead.
Example 9: Get a value from another column at the max date in Power BI
This is the most searched scenario: “return the product (or amount, or status) from the row with the latest date.” You can’t get it with MAX alone, because MAX returns a date, not the row.
Method 1: Find the max date, then filter to it
Latest Product =
VAR LastDate1 = MAX ( Sales[OrderDate] )
RETURN
CALCULATE (
SELECTEDVALUE ( Sales[Product] ),
Sales[OrderDate] = LastDate1
)

| Region | Latest Product |
|---|---|
| East | Chair |
| North | Phone |
| West | Laptop |
| Total | (blank) |
Why is the total blank? At the total level the latest date is 2026-04-20, which has two rows (Chair and Phone). SELECTEDVALUE returns blank when there is more than one value. You have two options:
Show all tied values — replace SELECTEDVALUE(...) with:
CONCATENATEX ( VALUES ( Sales[Product] ), Sales[Product], ", " )
The total now shows Chair, Phone.
Method 2: TOPN with a tie-breaker (always returns one row)
Latest Product (TOPN) =
VAR LastRow =
TOPN (
1,
Sales,
Sales[OrderDate], DESC,
Sales[OrderID], DESC
)
RETURN
MAXX ( LastRow, Sales[Product] )

The second sort key (OrderID) breaks the tie, so the total returns Phone (order 10). Region rows return the same values as Method 1. Use this method when the business rule is “the most recent record wins.”
Sum of a value on the latest date
Sales on Latest Date =
VAR LastDate = MAX ( Sales[OrderDate] )
RETURN
CALCULATE ( [Total Sales], Sales[OrderDate] = LastDate )
Result: East = 1200, North = 1600, West = 2400, Total = 2800 (both orders on 2026-04-20).
For more date-focused patterns, see my guide on Power BI DAX Max Date.
Example 10: Max date with a condition
Latest order date for Laptops:
Last Laptop Order =
CALCULATE (
MAX ( Sales[OrderDate] ),
Sales[Product] = "Laptop"
)

Result: 2026-04-06. MAX works on date columns just like numbers.
Example 11: Fix the total row (sum of max values)
In Example 1, the total row showed 4000 — the max of all rows — not 3600 + 1600 + 4000. If you want the total to add up the per-region maximums:
Sum of Region Max =
SUMX (
VALUES ( Sales[Region] ),
[Max Sale]
)
Each region row still shows its own max, and the total now shows 9200.
Example 12: Handle blanks in MAX
MAX(column) skips blanks. If every row in the current context is blank (or there are no rows), it returns BLANK — which hides the row in many visuals. To show 0 instead:
Max Sale or Zero =
COALESCE ( [Max Sale], 0 )
Be careful with the two-argument version, MAX(expr1, expr2): it treats a blank as 0. So MAX(-5, BLANK()) returns 0, not -5 — a subtle bug when comparing negative values.
Common mistakes with DAX MAX and filters
- Same value in every row. Your filter uses
ALL(Sales)or overrides the column that’s on the visual (see Example 2). UseKEEPFILTERSorALLSELECTED. - Blank total with SELECTEDVALUE. There’s a tie or multiple values at the total level — use
CONCATENATEXorTOPN(Example 9). MAX([Measure])gives an error. MAX needs a column. UseMAXX(VALUES(...), [Measure])(Example 6).- Calculated column doesn’t respond to slicers. That’s by design — use a measure.
- MAX on a TRUE/FALSE column fails. Use
MAXA, or convert the column to 1/0. - Slow reports on large tables. Replace
MAXX(FILTER(FactTable, ...), col)withCALCULATE(MAX(col), column predicates)where possible.
Frequently asked questions
How do I use MAX with a filter in DAX?
Wrap MAX in CALCULATE and add the condition as a filter argument: CALCULATE(MAX(Sales[SalesAmount]), Sales[Category] = “Electronics”). For a calculated expression, use MAXX(FILTER(Table, condition), expression).
What is the difference between MAX and MAXX in Power BI?
MAX returns the largest value in a single column. MAXX iterates a table, evaluates an expression for each row and returns the largest result, so it can handle calculations and measures.
How do I get the max value ignoring slicers?
Use CALCULATE(MAX(column), ALL(Table)) or REMOVEFILTERS(Table). If you want to ignore only the visual’s rows but keep slicers, use ALLSELECTED.
How do I return a value from another column for the max date?
Store the max date in a variable, then filter to it: VAR d = MAX(T[Date]) RETURN CALCULATE(SELECTEDVALUE(T[Value]), T[Date] = d). If several rows share the max date, use TOPN with a tie-breaker column.
Can MAX return text or dates?
Yes. MAX works on date columns (returning the latest date) and on text columns, where it returns the last value in alphabetical order. For TRUE/FALSE columns use MAXA.
Why does my MAX measure return blank?
No rows survive the current filter context, or all values are blank. Check slicers and relationships, and use COALESCE([Measure], 0) if you’d rather show zero.
Conclusion
To use DAX MAX with a filter in Power BI, remember three patterns: CALCULATE(MAX(col), condition) for a single column, MAXX(FILTER(...), expression) for calculated values and measures, and “max date + CALCULATE” (or TOPN) to pull another column’s value from the latest row. Add REMOVEFILTERS, ALLSELECTED or ALLEXCEPT when you need to control which filters apply.
You may also like:

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.