Forum Discussion

ekoland88's avatar
ekoland88
Frequent Visitor
6 years ago
Solved

Aggregation only for values greater than 0

Hi all,

I have the above table on power bi.

Description is a category of products, Quantity to expire is a measure from Stock table, Forecast is another measure from Forecast table. Risc BDD is Quantity-Forecast.

How can I show as Total on Risc BDD column only the 617 not all the aggregation which shows -11581 result.

Thank you!

  • ekoland88 , I think this should work

    if([RiskBDD]>0, [RISK BDD],0)

     

    But if do not get a grand total

    Try sumx(table,if([RiskBDD]>0, [RISK BDD],0))

    or  sumx(values(table[description]),if([RiskBDD]>0, [RISK BDD],0))

3 Replies

    • ekoland88's avatar
      ekoland88
      Frequent Visitor

      Yes, RiskBDD is indeed a measure but what table should I use in the sumx? 

      • amitchandak's avatar
        amitchandak
        Icon for Super User rankSuper User

        ekoland88 , I think this should work

        if([RiskBDD]>0, [RISK BDD],0)

         

        But if do not get a grand total

        Try sumx(table,if([RiskBDD]>0, [RISK BDD],0))

        or  sumx(values(table[description]),if([RiskBDD]>0, [RISK BDD],0))