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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

DAX: Max function creates duplicate rows in my table

I am trying to limit the result of a calculation to only positive values using the MAX function, but everytime I use MAX in my calculation it blows up my pivot table by creating millions of rows.  Below is my DAX Formula...

 

ExcessBalance:=MAX([Average of Total Demand]- LOOKUPVALUE(Parameters[Value], Parameters[Parameter], "Max Balance - # of Days")*[Average of Total Demand], 0)

 

If I just use the calculation without MAX (below)  it works fine which leads me to believe that the MAX function is the problem.  

 

ExcessBalance:= Average of Total Demand]- LOOKUPVALUE(Parameters[Value], Parameters[Parameter], "Max Balance - # of Days")*[Average of Total Demand]

 

The LOOKUPVALUE is finding the "Max Balance - # of Days" row in the parameters table.  The parameters table is unrelated to the table where I am trying to create the DAX measure.

 

What am I doing wrong?  What further information do you need to help debug??

 

Thanks in advance!!

 

Lee

 

1 REPLY 1
v-jianboli-msft
Community Support
Community Support

Hi @Anonymous ,

 

Sorry for that the information you have provided is not making the problem clear to me. Can you please share more details to help us clarify your scenario?

Please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.