Forum Discussion

Chavas's avatar
Chavas
Icon for Helper II rankHelper II
6 years ago
Solved

Calculate average per month based on status

Hello all. 
I am struggling with a metric which should be easy, but I do not know why it is not showing the information.
I have a table with the connection status of multiple entities. Each row means a connection status per day per entity, as a sample:

Entity CodeDATEConnection Status
111-08-19A
211-08-19A
311-08-19B
111-08-20A
211-08-20B
112-08-20B
212-08-20C
101-09-20A
201-09-20B
301-09-20C



So I have 4 graphs based on the status showing the total amount and compared with other years. As an example, for Status A:


Nevertheless now I would like to show it in % of the total that month. So I have created the next metric:
 

Status Average = CALCULATE(COUNTA(ConnectionStatus[EntityCode]),ConnectionStatus[Connection_Status]="STATUS A")
/ COUNTA(ConnectionStatus[EntityCode])

Nevertheless when applied to the visual is not showing the proper value but this:
Visual with Metric applied

In top of that, I would love to make one single metric, not one for each Connection_Status, is that possible? I am not being able to use the SELECTEDVALUE function, but I bet because I cannot apply it into the visual itself.

I have tried to play with the Average(s) functions but are not working properly for me.


Thanks in advance
  • I had the visual filtered. Once removed the filter it starts to work.

     

    I had created one metric for each status.

4 Replies

    • Chavas's avatar
      Chavas
      Icon for Helper II rankHelper II

      Sure, first thing first. There was a Typo, now it is showing all as 1

       
       
       

      Visual with Metric applied



      Sample of table:

      Entity CodeDATEConnection Status
      111-08-19A
      211-08-19A
      311-08-19B
      111-08-20A
      211-08-20B
      112-08-20B
      212-08-20C
      101-09-20A
      201-09-20B
      301-09-20C
      • Chavas's avatar
        Chavas
        Icon for Helper II rankHelper II

        My bad...

        God, visual filter was applying to the measure that is why it was not working propery.
        So, is anyway that I can avoid hardcoding the Filter on the metric and set it on the visual?

  • I had the visual filtered. Once removed the filter it starts to work.

     

    I had created one metric for each status.