Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Count of average

Hello!

 

I'm trying to make a visualization that shows the count of average of a driver's driving index.

 

Here are my group conditions, so if the driver's  average driving index is 83 it should count it to the "80-85" category.

 

Group Values DrivingIndex =
SWITCH (
TRUE();
CombinedTable[drivingindex] >= 0
&& CombinedTable[drivingindex] < 80; "<80";
CombinedTable[drivingindex] >= 80
&& CombinedTable[drivingindex] <= 85; "80-85";
CombinedTable[drivingindex] >= 86
&& CombinedTable[drivingindex] <=90; "85-90";
CombinedTable[drivingindex] >= 91
&& CombinedTable[drivingindex] <=95; "90-95";
CombinedTable[drivingindex] >= 96
&& CombinedTable[drivingindex] <=100; "95-100";
"Other"
)

I tried calculating the count of average with this syntax but it is not working and i'm not sure if it's even the right way to go about it.

Average total = IF(HASONEFILTER(CombinedTable[driver_id]);
[Driving index average];
COUNTX(ALL(CombinedTable[drivingindex]); [Driving index average]))
 
 
Here is my usual average calculation:
Driving index average = AVERAGE(CombinedTable[drivingindex])
 
Example of what I'm trying to achieve. So count of the averages in each group.Example of what I'm trying to achieve. So count of the averages in each group.
1 REPLY 1
lbendlin
Super User
Super User

That has nothing to do with averages. You may call it a 'distribution"  but you should not really use a line chart - there is no correlation between your buckets.  Column charts are much more appropriate.

 

By the way your grouping can be simplified

Group Values DrivingIndex = SWITCH (TRUE();
CombinedTable[drivingindex] < 0; "Other";
CombinedTable[drivingindex] < 80; "<80";
CombinedTable[drivingindex] <= 85; "80-85";
CombinedTable[drivingindex] <=90; "85-90";
CombinedTable[drivingindex] <=95; "90-95";
CombinedTable[drivingindex] <=100; "95-100";
"Other")

 

 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.