Forum Discussion

sunah132's avatar
sunah132
Helper I
5 years ago
Solved

Sum up minimum value and 0 value

Hello, 

I'm working on this power BI Matrix and not sure about this step forward. I have brought minimum values of each region's rate based on their dates. I used the formula of

SWITCH (
TRUE (),
ISINSCOPE ( 'Table'[item] ), SUMX ( VALUES ( 'Table'[Date] ), MIN ( 'Table'[Value] ) ),
SUM ( 'Table'[Value] )
)

to get the total rates. The problem I'm facing is that when there's no rate on days for example of 6/5 on Austin, it counts as 0 thus the total becomes 0. Could you please see how this formula can skip the 0 values and still summarize the total?

Thank you very much.

Region1-Jun2-Jun3-Jun4-Jun5-JunExpected TotalCurrent Matrix
Austin101010100400
Dallas0252525251000
Houston202020200800
San Antonio020202020800
Total3075757545300 
  • Hi sunah132 

     

    You could try this measure:

    Measure_Value = 
    IF (
        ISINSCOPE ( 'Table'[Route] ) && ISINSCOPE ( 'Table'[Date] ),
        MIN ( 'Table'[Value] ),
        SUM ( 'Table'[Value] )
    )

     

    Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as the solution to help other members find it.

3 Replies

  • Thank you for the suggestion!

    I tried on your suggestion and I should have mentioned this but there are multiple routes under each region. When I applied on yours, it took the sum including 0 but wasn't able to show the route rate at drill down.

    Region1-Jun2-Jun3-Jun4-Jun5-JunTotal
    Austin10101010 40
    12222 8
    23333 12
    33333 12
    42222 8
    • v-jingzhang's avatar
      v-jingzhang
      Community Support

      Hi sunah132 

       

      You could try this measure:

      Measure_Value = 
      IF (
          ISINSCOPE ( 'Table'[Route] ) && ISINSCOPE ( 'Table'[Date] ),
          MIN ( 'Table'[Value] ),
          SUM ( 'Table'[Value] )
      )

       

      Regards,
      Community Support Team _ Jing
      If this post helps, please Accept it as the solution to help other members find it.