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
mumair
Helper I
Helper I

How to Segment Data

So let's say I have 40 rows of data. Each row has one location, and there are 5 total possibilities. There is also a time to complete a task associated with each row. How can I show the average time to complete the task segmented by location?

1 ACCEPTED SOLUTION

Hi @mumair,

Please create measure using the formula below.

Average = AVERAGEX( DISTINCT(SELECTCOLUMNS(Table2,"Train",Table2[Train],"Location",Table2[Location],"Time",Table2[Time to Complete Inspection])),[Time])


Create a table visual to display the result.

1.PNG

Thanks,
Angelia

View solution in original post

4 REPLIES 4
mumair
Helper I
Helper I

Actually I have another complication. Say my data looks like this:

 

Shipment | Train | Location | Time to Complete Inspection

Order 1 | Train A | New York | 60

Order 2 | Train A | New York | 60

Order 3 | Train B | New York | 30

Order 4 | Train C | Chicago | 45

Order 5 | Train C | Chicago | 45

 

I want to know the average time to complete inspection per location. The time to complete inspection is related to the train, and not the shipment. Right now my calculations say it takes an average of 50 minutes to complete inspections at New York. This is incorrect. It should say it takes an average of 45 minutes to complete an inspection. This is because there are only 2 inspections at New York, Train A and Train B, not 3. How do I fix this?

Hi @mumair,

Please create measure using the formula below.

Average = AVERAGEX( DISTINCT(SELECTCOLUMNS(Table2,"Train",Table2[Train],"Location",Table2[Location],"Time",Table2[Time to Complete Inspection])),[Time])


Create a table visual to display the result.

1.PNG

Thanks,
Angelia

@mumair Can you post your dax code and put a screen shot of your visual?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




vanessafvg
Super User
Super User

try the quick measures until you get the  hang of it

 

@mumair

 

https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-quick-measures/

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




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