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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Mariestar
Frequent Visitor

average filtered by categories

Hello community 🙂 

 

I have the following problem when trying to calculate the average, filter by categories and sort by the minimun value: 

 

What I need 😁

I need to calculate the average departure time for each mission ID.

Filter by mission ID to show only the average for each mission ID

Sort by the minimun value of departure_time so starting from the earliest departure_time 

 

What I use which doesnt work 😞

CALCULATE(AVERAGE('table'[departure_time], FILTER('table','table'[Mission_ID]=MIN('table'[departure_time]

 

Any idea on how to solve this issue is much appreciated! 

 

Regards, 

Marie

 

2 REPLIES 2
Mariestar
Frequent Visitor

Thank you @v-yangliu-msft 

 

It's more complecated than that. I am attaching a photo to show you how my dashboard is. I created the mesure but doesnt fit to my matrice table because I have the days and the mesure is also classed for each day. 

 

Thank you very much, Pls let me know if you can help me, 

 

Regards,

Marie

powerbitest.png

v-yangliu-msft
Community Support
Community Support

Hi  @Mariestar ,

I created some data:

vyangliumsft_0-1666148877167.png

Here are the steps you can follow:

1. Create measure.

avg_Measure =
AVERAGEX(FILTER(ALL('Table'),
'Table'[Mission_ID]=MAX('Table'[Mission_ID])),[departure_time])
Sort_measure =
RANKX(
    ALL('Table'),[avg_Measure],,ASC,Dense)

2. Result:

vyangliumsft_1-1666148877168.png

If you need pbix, please click here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.