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! Request now

Reply
grapple_75
Regular Visitor

Average Measure : matrix row and sub row calculation

Hi

 

I have a table which lists Vehicle Type, Vehicle Id, Date, Journey Id and Journey Duration.

Each Vehicle Id completes multiple journeys across multiple dates.

 

Screenshot 2024-12-18 161327.jpg

 

 

 

 

 

 

 

 

 

 

 

 

I am need a measure that not only calculates the Average Total Duration by Vehicle ID but also at the higher Vehicle Type level.

 

My matrix visual looks something like this.......

 

Screenshot 2024-12-18 162123.jpg

 

 

 

I know the issue relates to the count of distinct dates which at Vehicle Type level equals 3, the same as each Vehicle ID.  I need the measure to take into account the number of vehicle ids when calculating the average at Vehicle Type level.

 

Any help will be greatly appreciated. Thanks.

 

1 ACCEPTED SOLUTION
grapple_75
Regular Visitor

looks like I've now solved this using.....

 

Measure =
var _tbl1 = SUMMARIZE(Vehicle_Journey, Vehicle_Journey[vehicleId], Vehicle_Journey[StartDate],"a",sum(Vehicle_Journey[Journey Duration]))
var _average = averagex(_tbl1,[a])
return _average
 
have spent a whole day battling with this and then work it out within a few minutes of posting for help 🙄!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @grapple_75 ,

 

Thank you for sharing, this will help more people!!

 

 

Best regards,

Mengmeng Li

grapple_75
Regular Visitor

looks like I've now solved this using.....

 

Measure =
var _tbl1 = SUMMARIZE(Vehicle_Journey, Vehicle_Journey[vehicleId], Vehicle_Journey[StartDate],"a",sum(Vehicle_Journey[Journey Duration]))
var _average = averagex(_tbl1,[a])
return _average
 
have spent a whole day battling with this and then work it out within a few minutes of posting for help 🙄!

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.

Top Solution Authors