Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
hello_
Helper I
Helper I

Measure that returns the Max value by multiple catagories

hello__0-1705299841517.png

 

 

Hello Authors I am in a bite of bind please help I want to make a DAX Measure that returns the top or MAX value only by that categories please Guide me 

 

Thank You 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @hello_ ,

 

Please follow these steps:

1.You can create a new metric and write the following expression.

Measure =

var _max_cou =

MAXX(

    FILTER(

        ALL('Table'),

        'Table'[Category_1]=MAX('Table'[Category_1])&&'Table'[Category_2]=MAX('Table'[Category_2])),

    [Count_Category])

RETURN

IF(MAX('Table'[Count_Category]) = _max_cou,

_max_cou,

BLANK()

)

vkaiyuemsft_0-1705395934480.png

2.The results obtained are shown below.

vkaiyuemsft_1-1705396097670.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

4 REPLIES 4
hello_
Helper I
Helper I

Thank You very much 

 

Anonymous
Not applicable

Hi @hello_ ,

 

Please follow these steps:

1.You can create a new metric and write the following expression.

Measure =

var _max_cou =

MAXX(

    FILTER(

        ALL('Table'),

        'Table'[Category_1]=MAX('Table'[Category_1])&&'Table'[Category_2]=MAX('Table'[Category_2])),

    [Count_Category])

RETURN

IF(MAX('Table'[Count_Category]) = _max_cou,

_max_cou,

BLANK()

)

vkaiyuemsft_0-1705395934480.png

2.The results obtained are shown below.

vkaiyuemsft_1-1705396097670.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thank You Sir for the solution it helps 🙏😊

123abc
Community Champion
Community Champion

Certainly! In Power BI, you can create a DAX measure to return the maximum value by multiple categories. Assuming you have a table with the relevant data, and you want to find the maximum value based on certain categories, you can use the following DAX formula as an example:

 

MaxValueByCategory =
CALCULATE(
MAX('YourTableName'[YourNumericColumn]),
ALLEXCEPT('YourTableName', 'CategoryColumn1', 'CategoryColumn2', ...)
)

 

Here, replace 'YourTableName' with the actual name of your table, 'YourNumericColumn' with the column containing the values you want to find the maximum of, and 'CategoryColumn1', 'CategoryColumn2', etc., with the columns representing your categories.

The ALLEXCEPT function removes all filters from the table except for the specified columns, ensuring that the maximum is calculated within the selected categories.

For example, if you have a Sales table with columns 'Product', 'Region', and 'SalesAmount', and you want to find the maximum sales amount by product and region, the formula would look like this:

 

MaxSalesByProductAndRegion =
CALCULATE(
MAX('Sales'[SalesAmount]),
ALLEXCEPT('Sales', 'Product', 'Region')
)

 

Adjust the column names based on your specific dataset and requirements. If you have more than two categories, include additional columns within the ALLEXCEPT function.

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.