Setting a Maximum value for a DAX measure

DickyMoo

New Member
Joined
Mar 8, 2016
Messages
32
Hi everyone,

Is there a way to set a MAX value for a measure? I.e. the equivalent of Excel's =MIN(A1*A2,100).

I have a list of percentage variances against budget and some are massive eg 21,000%, it would be nice to show this as 100%, so I can use conditional formatting (in PowerPivot).

I suspect I can do an IF('measure' > 100, ">100%", <measure>), but this might cause performance issues as I'd be doing calcs twice.

Thanks for any advice you may have.

(fyi I have also posted this on Excelguru.ca)

Richard
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Hi Richard,

Current versions of DAX (e.g. Excel 2016 or Power BI Desktop) include MIN and MAX functions which can operate on two scalar expressions, same as Excel.
So you can write expressions like MIN( [Measure], 100 )

Unfortunately, earlier versions of DAX (e.g. Excel 2013/2010) don't have this feature (MIN and MAX can only return min or max of a column), so you are stuck doing the calculation twice within an IF as you have described.
 
Upvote 0
Ok, thanks Ozeroth, I appreciate your response.

I am using PowerPivot in 2010 but upgrading to 2016 in a couple of months so will make do until then.

Richard
 
Upvote 0

Forum statistics

Threads
1,224,154
Messages
6,176,731
Members
452,740
Latest member
MrCY

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top