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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ManeMan
Frequent Visitor

ROUNDDOWN with a minimum of 1

Greetings, looking to round a formula down but I'm running in to an issue where values less than 0.5 return a 0.  I'd like to set a minimum value of 1 in these instances.

 

I've tried an if/then statement where IF the formula returns a value equal to "0" then change it to "1" but the issue with this is that it messes with the grouping and returns a hundreds of blank values and repeats the groups hundreds of times.

Here's the forumula I'm using.  Help is much appreciated.

10% Increase:=ROUNDDOWN([# New SS (LY)]*VALUES(Increase_Target[NEW SS increase:]),0)

 

4 REPLIES 4
n8ball
Helper I
Helper I

Give this a try:

 

10% Increase =
VAR new_ss = ROUNDDOWN ( [# New SS (LY)] * VALUES ( Increase_Target[NEW SS increase:] ), 0 )
RETURN
IF (ISBLANK (new_ss), BLANK(), MAX ( new_ss, 1))

 

You expression is strange though. I assume this is a calculated column. VALUES returns a table of all unique values in the column referanced. I think you want to use something different there, like CALCULATE ( SUM(...
Maybe because of how your model is built you are getting lucky but this could be a source for breakage. 

WinterMist
Impactful Individual
Impactful Individual

@ManeMan 

 

My apologies.  This is a bit more complex than I originally thought.

 

- How is the hierarchy defined?  What are the parent, child, granchild items?

- Can you also show an example which displays the column names used, and the definitions of measures within your original measure "[10% Increase]"?

- Ah actually, this is a Calculated Column (and not a measure), correct?

 

Regards,

Nathan

WinterMist
Impactful Individual
Impactful Individual

@ManeMan 

 

Could you provide a small dataset example & visual which show the issue mentioned?

 

ISSUE: "...it messes with the grouping and returns a hundreds of blank values and repeats the groups hundreds of times."

 

Regards,

Nathan

If I ROUNDDOWN but don't set a minimum of "1"... I get each business unit properly mapped out in the hierarchy.

ManeMan_0-1679340973238.png



If I add an IF/THEN statement (if the rounddown formula is less than 1), it breaks the hierarchy and lists every child unit in the company under every parent unit with no value (just blanks).

Effectively, what I want is the first scenario but I want the "0's" to be "1's".

ManeMan_1-1679342943438.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors