Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Need count for matrix non zero values

Hi Team,

Please find the screenshot below, the visual used is matrix. Now I nee dto have count of all non zero values as mentioned in figure, Kindly help . Thsi can be another visual or part of same table.

 

Thanks

Swapnil

  • Anonymous,

     

    You may refer to the following measure.

    Measure =
    IF (
        HASONEVALUE ( Table1[Date] ),
        SUM ( Table1[Qty] ),
        COUNTROWS (
            FILTER ( VALUES ( Table1[Date] ), CALCULATE ( SUM ( Table1[Qty] ) ) > 0 )
        )
    )
    

6 Replies

  • ChrisMendoza's avatar
    ChrisMendoza
    Resident Rockstar

    hello Anonymous,

     

    Try something like:

     

    as a calculated column:

    IF Statement = IF(Table2[Qty]<=0,BLANK(),1)

    as a measure:

    Count IFs = COUNT(Table2[IF Statement]) 

    // SUM should work as well.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      But if I want to put same in same matrix as last column then how would I do it ?As If I put this in column it creates multiple columns with same value

      • ChrisMendoza's avatar
        ChrisMendoza
        Resident Rockstar

        Yeah, that's why it's in another visual per your statement where you said it can be in another visual.

  • v-chuncz-msft's avatar
    v-chuncz-msft
    Community Support

    Anonymous,

     

    You may refer to the following measure.

    Measure =
    IF (
        HASONEVALUE ( Table1[Date] ),
        SUM ( Table1[Qty] ),
        COUNTROWS (
            FILTER ( VALUES ( Table1[Date] ), CALCULATE ( SUM ( Table1[Qty] ) ) > 0 )
        )
    )