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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
armchairexpert
Helper II
Helper II

MAX Total Revenue On Card

Hi,

 

I have a table like below:

 

armchairexpert_0-1642520995062.png

 

When the user selects multiple months on Power BI, for example January and February, I show the following:

 

armchairexpert_1-1642521062649.png

 

On the card I have to show the Maximum Revenue which is 260,000. As it will be 'Category A' which will be always the maximum, I can also say Category = 'Category A' in the measure. I am using the below measure for the card:

 

Total Revenue = MAXX('Test Table','Test Table'[Revenue])

 

However, it is not showing the aggregated total 260,000 instead it is showing 135,000 which is the maximum for February. What am I doing wrong?

 

Thanks.

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

The measure you've written iterates over each of the rows of 'Test Table' within the filter context and each month is in a separate row of this data table. You haven't told it that you want to aggregate before taking a max.

 

You need to iterate over the granularity that you want to aggregate at:

Max Description-Category Revenue =
MAXX (
    SUMMARIZE (
        'Test Table',
        'Test Table'[Description],
        'Test Table'[Category],
        "Rev", SUM ( 'Test Table'[Revenue] )
    ),
    [Rev]
)

View solution in original post

2 REPLIES 2
AlexisOlson
Super User
Super User

The measure you've written iterates over each of the rows of 'Test Table' within the filter context and each month is in a separate row of this data table. You haven't told it that you want to aggregate before taking a max.

 

You need to iterate over the granularity that you want to aggregate at:

Max Description-Category Revenue =
MAXX (
    SUMMARIZE (
        'Test Table',
        'Test Table'[Description],
        'Test Table'[Category],
        "Rev", SUM ( 'Test Table'[Revenue] )
    ),
    [Rev]
)

It worked. Thanks!! 😊

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.