Forum Discussion
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 Code | DATE | Connection Status |
| 1 | 11-08-19 | A |
| 2 | 11-08-19 | A |
| 3 | 11-08-19 | B |
| 1 | 11-08-20 | A |
| 2 | 11-08-20 | B |
| 1 | 12-08-20 | B |
| 2 | 12-08-20 | C |
| 1 | 01-09-20 | A |
| 2 | 01-09-20 | B |
| 3 | 01-09-20 | C |
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:
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.
I had the visual filtered. Once removed the filter it starts to work.
I had created one metric for each status.
4 Replies
- amitchandak
Super User
Chavas , Not very clear. Can you share sample data and sample output in a table format?
refer if this can help https://community.powerbi.com/t5/Desktop/Percentage-of-subtotal/td-p/95390
- Chavas
Helper II
Sure, first thing first. There was a Typo, now it is showing all as 1
Visual with Metric applied
Sample of table:Entity Code DATE Connection Status 1 11-08-19 A 2 11-08-19 A 3 11-08-19 B 1 11-08-20 A 2 11-08-20 B 1 12-08-20 B 2 12-08-20 C 1 01-09-20 A 2 01-09-20 B 3 01-09-20 C - Chavas
Helper 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?
- Chavas
Helper II
I had the visual filtered. Once removed the filter it starts to work.
I had created one metric for each status.