cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Post Patron

## SUM the MAX Values

Hi everyone,

I browsed through several topics but couldnt find an answer...so I am writing now 🙂

I have a Matrix with several Max Values. The Matrix has the granularity of "City". However, I want to SUM the MAX values for that given Country.

Think of the values in the columns as people with blond, brunette and black hair. Hence in Germany we have 3 hair types in total and not 4 (which would be the sum). In Munich we have 1 hair type.

1 ACCEPTED SOLUTION
Post Patron

I have found a solution on my own. It was after all more simple than I have initially thought.

``````Value =
MAXX( TABLE ,TABLE[Max value A] ) +
MAXX( TABLE ,TABLE[Max value B] ) +
MAXX( TABLE ,TABLE[Max value C] )``````
7 REPLIES 7
Post Patron

I have found a solution on my own. It was after all more simple than I have initially thought.

``````Value =
MAXX( TABLE ,TABLE[Max value A] ) +
MAXX( TABLE ,TABLE[Max value B] ) +
MAXX( TABLE ,TABLE[Max value C] )``````
Community Support

Hi @raymond ,

You could try the following measure:

``Measure = CALCULATE(MAX('Table'[Max value A])+MAX('Table'[Max value B])+MAX('Table'[Max value C]),FILTER(ALL('Table'),'Table'[Country]=MAX('Table'[Country])))``

base  data:

And final output:

Wish it is helpful for you!

Best Regards

Lucien

Super User

Hi @raymond ,
What is your logic that Germany's sum is 3 and not 4?

Proud to be a Super User!

Post Patron

Thank you.

I want to find out how many values generally occur for each country. In Germany only 3 attributes or traits occur.

Think of it as people with blond, brunette and black hair. Hence in Germany we have 3 hair types and not 4. In Munich we have 1 hair type.

Super User

Hey @raymond ,

the following should work:

``New Column = CALCULATE( MAX( myTable[Max Value A] ), ALLEXCEPT( myTable, myTable[City] ) ) + CALCULATE( MAX ( myTable[Max Value B] ), ALLEXCEPT( myTable, myTable[City] ) ) + CALCULATE( MAX ( myTable[Max Value C] ), ALLEXCEPT( myTable, myTable[City] ) )``

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Super User

@raymond , If Max Value A , MAx Value B are column values not measure

then try

sumx(summarize(Table, Table[country], Table[city], "_1", CALCUALTE(Max(Table[Value]))), [_1])

Post Patron

Thank you @amitchandak and @Nathaniel_C but unfortunately this wasnt working the way it was intended.

Think of the values in the columns as people with blond, brunette and black hair. Hence in Germany we have 3 hair types and not 4. In Munich we have 1 hair type.

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors