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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
Anonymous
Not applicable

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

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors