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
Anonymous
Not applicable

Exclude Zeros and Blanks from MIN

I created a measure to give me the bottom third and I don't want to include Zero or Blank rows because it makes the calculation incorrect.

 

Current Measure:

CALCULATE(
(MAX (JiraEpic[StoryPoints]) - MIN (JiraEpic[StoryPoints]))/3 + MIN (JiraEpic[StoryPoints]),
ALLEXCEPT (JiraEpic, JiraEpic[ScrumTeamName])
)

 

If I add 

FILTER(JiraEpic,JiraEpic[StoryPoints]<>0 || JiraEpic[StoryPoints]<>BLANK()),
 
It breaks the measure and gives me a different min for each row instead of the overall for a scrum team.
 
See Example:   I want the measure to be (104-5)/3 + 5=38 ,  However I get (104-0)/3 + 0=35
Story Points
 
0
0
 
5
0
5
49
26
6
104
44


1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @Anonymous 

try

=
var _minVal = CALCULATE(MIN (JiraEpic[StoryPoints]), ALLEXCEPT (JiraEpic, JiraEpic[ScrumTeamName]), JiraEpic[StoryPoints]<>0, NOT(ISBLANK(JiraEpic[StoryPoints])) )

RETURN

(
CALCULATE(MAX (JiraEpic[StoryPoints]), ALLEXCEPT (JiraEpic, JiraEpic[ScrumTeamName]), JiraEpic[StoryPoints]<>0, NOT(ISBLANK(JiraEpic[StoryPoints])) )
-
_minVal 
) / 3
+
_minVal 

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

3 REPLIES 3
Vvelarde
Community Champion
Community Champion

@Anonymous 

 

Hi, try with this:

 

Result =
VAR _table_without_0_and_blanks =
    FILTER (
        ALLEXCEPT ( 'Table', 'Table'[Team] ),
        'Table'[Story Points] <> 0
            || 'Table'[Story Points] <> BLANK ()
    )
VAR _Min =
    CALCULATE ( MIN ( 'Table'[Story Points] ), _table_without_0_and_blanks )
VAR _Max =
    CALCULATE ( MAX ( 'Table'[Story Points] ), _table_without_0_and_blanks )
RETURN
    DIVIDE ( _Max - _Min, 3 ) + _Min

 

Regards

 

Victor




Lima - Peru
amitchandak
Super User
Super User

@Anonymous ,

Try like

FILTER(JiraEpic,JiraEpic[StoryPoints]<>0 && not(isblank(JiraEpic[StoryPoints])))

 

Or

CALCULATE(
(MAXX (FILTER(JiraEpic,JiraEpic[StoryPoints]<>0 && not(isblank(JiraEpic[StoryPoints]))),JiraEpic[StoryPoints]) - MINX (FILTER(JiraEpic,JiraEpic[StoryPoints]<>0 && not(isblank(JiraEpic[StoryPoints]))),JiraEpic[StoryPoints]))/3 + MINX (FILTER(JiraEpic,JiraEpic[StoryPoints]<>0 && not(isblank(JiraEpic[StoryPoints]))),JiraEpic[StoryPoints]),
ALLEXCEPT (JiraEpic, JiraEpic[ScrumTeamName])
)
az38
Community Champion
Community Champion

Hi @Anonymous 

try

=
var _minVal = CALCULATE(MIN (JiraEpic[StoryPoints]), ALLEXCEPT (JiraEpic, JiraEpic[ScrumTeamName]), JiraEpic[StoryPoints]<>0, NOT(ISBLANK(JiraEpic[StoryPoints])) )

RETURN

(
CALCULATE(MAX (JiraEpic[StoryPoints]), ALLEXCEPT (JiraEpic, JiraEpic[ScrumTeamName]), JiraEpic[StoryPoints]<>0, NOT(ISBLANK(JiraEpic[StoryPoints])) )
-
_minVal 
) / 3
+
_minVal 

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.