Forum Discussion

AmberJane's avatar
AmberJane
Icon for Helper III rankHelper III
4 years ago
Solved

% Difference from two filtered fields on a column

Hi Team, 

 

I am these tickets that go through different states that you can see in the screenshot below. I want to show the % of tickets that have been closed. I think the way to do this is to create a column or measure (not sure) that takes the # of tickets and divides it by the # of tickets in the state of closed. In this specific screenshot there is 17 tickets total and 5 have been closed so I want it to show 29%. 

 

Any help is appreciated! 

 

 

  • AmberJane 

    You can do that with a measure like this.

    Closed % = 
    VAR _Closed = CALCULATE ( [Work Items Count], KEEPFILTERS ( YourTable[State] = "Closed" ) )
    VAR _All = CALCULATE ( [Work Items Count], REMOVEFILTERS ( YourTable[State] ) )
    RETURN DIVIDE ( _Closed, _All )

2 Replies

  • AmberJane 

    You can do that with a measure like this.

    Closed % = 
    VAR _Closed = CALCULATE ( [Work Items Count], KEEPFILTERS ( YourTable[State] = "Closed" ) )
    VAR _All = CALCULATE ( [Work Items Count], REMOVEFILTERS ( YourTable[State] ) )
    RETURN DIVIDE ( _Closed, _All )
    • AmberJane's avatar
      AmberJane
      Icon for Helper III rankHelper III

      That did the trick! I feel like there should be an easier way to accomplish this but thank you for the measure details. It has me moving forward.