Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello,
I’m encountering an issue with a measure in PowerBI where I need to include zero counts in an average calculation. My current setup involves calculating the average number of sessions per CP ID, but I’m finding that the measure incorrectly excludes zero counts when a CP ID has no sessions on a particular date. (My data is regarding EV charging sessions)
Here is my current set-up:
1. A measure to work out the average number of sessions per charger:
For example, on 18th June:
The measures are returning an average of 3.5 sessions, while the correct average should be 2.3.
Does anyone have any ideas on how I could resolve this issue? I need to ensure that days with zero sessions are included in the average calculation.
Any help or suggestions would be greatly appreciated!
@SemaD_ , Try using
Total Sessions per CP ID per Day =
CALCULATE(
COUNTA('Pogo E Connect Data'[SDR ID]),
KEEPFILTERS(VALUES('Pogo E Connect Data'[CP ID])),
KEEPFILTERS(VALUES('Calendar'[Date]))
)
Proud to be a Super User! |
|
Okay so this helped in some way by solving the 0 issue, so thank you! However I think because I am now focusing on the total sessions per day, rather than the average sessions per day, the overall average calculations don't seem quite correct.
Rather than the average of the sum of sessions per day, I actually need the average of the average sessions per day.
Take my example above, while the sum of sessions would be 7, the average of 7 sessions by 3 chargers is 2.33. For arguments sake lets say those chargers has the same output for the 30 days of June, then the monthly average would of course be 2.33. But based on the sum of sessions the monthly average would be 7. It is really important for me to do this on a per charger level.
The inital formula is almost working that out, but excludes 0s. I think if I can resolve that then the overall average formula would make sense.
I see empty values in the column. So just a note... AverageX ignores blank values but considers 0's in the calculation
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
9 | |
8 | |
8 |
User | Count |
---|---|
14 | |
12 | |
11 | |
11 | |
8 |