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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors