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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Why is MAXX not working for two columns for each raw? It will break my table.

Hello, 
Can anybody please tell me why my MAX formula is not working? (It's working when I create a table with PriceElectionAmount &  HarvestPrice columns ) . I am trying to get the MAX for the two columns (PriceElectionAmount &  HarvestPrice) for each row, but when I add my measure it will keep spinning and break the whole table. 
Any Help on how to get this? Basically, I want to get the max value from PriceElectionAmount &  HarvestPrice for each row. 
 
I have created two measures, did not work

 

MAX_Price = 
    MAXX({
            max('XL-Hargrove_MpciPremLine_Data'[ PriceElectionAmount]),
            MAX(PriceKeys[ HarvestPrice])
    },
    [Value]
    )​

 

and this,

 

MAX_Price_De = 
VAR ValueTable = 
    UNION(
        ROW("Value", SUM('XL-Hargrove_MpciPremLine_Data'[ PriceElectionAmount])),
        ROW("Value", SUM(PriceKeys[ HarvestPrice]))
      )
    RETURN 
    MAXX(
        ValueTable,
        [Value]
    )

 

Error,

error.PNG

 My table looks like,

My table looks likeMy table looks like

 

Thank you so much

 
7 REPLIES 7
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Your formulas looks fine and the error message means you don't have enough memory. 

How much RAM do you have and how big is your dataset?

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Fowmy
Super User
Super User

@Anonymous 

Your Measure should work, what was the error that you faced?

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

It just keeps spinning and give me Memory out error. 

Fowmy
Super User
Super User

@Anonymous 

I think you need the max of max from both the fields:

MAX_Price = 
MAX(
    MAX('XL-Hargrove_MpciPremLine_Data'[ PriceElectionAmount]),
    MAX(PriceKeys[ HarvestPrice])
)

 

If you need to iterate for some reason then try:

MAX_Price = 
MAXX(
    UNION(
        DISTINCT('XL-Hargrove_MpciPremLine_Data'[ PriceElectionAmount]),
        DISTINCT(PriceKeys[ HarvestPrice])
    ),
    [ PriceElectionAmount]
)

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

@Fowmy  surprisingly, your first formula works. Can you please tell me why my one did not load? I used MAXX. Thank you so much for the hlep. 

 

Ashish_Mathur
Super User
Super User

Hi,

Does this measure work?

=if(SUM('XL-Hargrove_MpciPremLine_Data'[ PriceElectionAmount])>SUM(PriceKeys[ HarvestPrice]),SUM('XL-Hargrove_MpciPremLine_Data'[ PriceElectionAmount]),SUM(PriceKeys[ HarvestPrice]))


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur I tried your one. It is something, just keep spinning. Thank you so much your help and time. 

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 MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.