Forum Discussion

Jodes007's avatar
Jodes007
Frequent Visitor
3 years ago
Solved

Create Measure to calculate Net impact on filtered value

Hello All 

 

I have not been able to find a solution for this. I have a large dataset, the very top level is ProgramID. I want to be able to filter on the Total NET impact of the ProgramID regardless of how many lines there are. The final intent would be to filter out any NET impact <0 on several other metrics.  

 

TIA

 

Sample of data below.  

PJ-2 is NET 296 so it would stay. 

PJ-3 is NET -9 so it would filter out. 

ProgramIDApplication Total Impact 
PJ-1AAAA                  168
PJ-1BBBB               1,950
PJ-2AAAA                  804
PJ-2BBBB                     (4)
PJ-2CCCC                (504)
PJ-3AAAA                     (4)
PJ-3BBBB                     (2)
PJ-3CCCC                     (2)
PJ-4AAAA                    21
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Jodes007 ,

     

    Sorry, not very clear. 

    If you want to filter out rows NET impact<0 in the visual. In the Filters, set up as follows.

    If you want to filter out NET impact<0 in the measure.

    COUNT TOTAL = CALCULATE(COUNT('Table'[ProgramID]),FILTER(ALLSELECTED('Table'),[Total Impact]>=0))
    COUNT GROUP BY ProgramID = CALCULATE(COUNT('Table'[ProgramID]),FILTER(ALLSELECTED('Table'),[ProgramID]=MAX('Table'[ProgramID])&&[Total Impact]>=0))

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Jodes007 ,

     

    Sorry, not very clear. 

    If you want to filter out rows NET impact<0 in the visual. In the Filters, set up as follows.

    If you want to filter out NET impact<0 in the measure.

    COUNT TOTAL = CALCULATE(COUNT('Table'[ProgramID]),FILTER(ALLSELECTED('Table'),[Total Impact]>=0))
    COUNT GROUP BY ProgramID = CALCULATE(COUNT('Table'[ProgramID]),FILTER(ALLSELECTED('Table'),[ProgramID]=MAX('Table'[ProgramID])&&[Total Impact]>=0))

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

    • Jodes007's avatar
      Jodes007
      Frequent Visitor

      Sorry, it should have read NET impact >0.  Filtering does not work as the Total impact is at the Application level where there are many lines. BUT the count group looks like it makes sense. I will try it today and see.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Jodes007 ,

         

        Is your problem solved?

        If so, please accept the reply as solution. More people will benefit.

        If not, please provide me with more details about it.

         

        Best Regards,

        Stephen Tao