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

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

Reply
harshagraj
Post Partisan
Post Partisan

Average loop type per project

HI all, I need average loop type for the below table. loop_type column is a dimension. Thanks in advance.
Need to display this in a card. I have a project slicer to filter.

ProjectToolNoloop_typeCount of loop_type
PRJ-1628-178Planned Loop2
PRJ-1728-179Finished Loop4
PRJ-1828-180Finished Loop6
PRJ-1928-181Planned Loop1
PRJ-2028-182Planned Loop1

avg.JPG

1 ACCEPTED SOLUTION

@harshagraj 

Loop count = countx(filter(Table, [project] =earlier([project]) && [loop type] = earlier([loop type])),[loop type])
Avg Loop =AverageX(filter(Table, [project] =earlier([project])),[Loop count])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

7 REPLIES 7
amitchandak
Super User
Super User

@harshagraj , not very clear

averagex(values(dim[Project]),max(Table[Count of loop_type]))

or
averagex(summarize(dim[Project],"_1",max(Table[Count of loop_type])),[_1])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak thanks for the reply. Actually i dont have [Count of loop_type] column i just changed that in value shelf from a table and dragged. 

@harshagraj , Not very clear, what you need?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Sorry for the trouble. I have Project Number,Tool Number,Loop Type as columns.
In Loop Type column i have values as (Finished & Planned). Each tool number will have one loop type. So i need Averge loop type per project.
Eg.

PRJ-1921-18Finished Loop
PRJ-1921-19Planned Loop

So this has 1 Finished and 1 Planeed. So i need to display Average loop as 1.

@harshagraj , in case you need column. Both as new columns

 

Loop count = countx(filter(Table, [project] earlier([project]) && [loop type] = earlier([loop type])),[loop type])
Avg Loop =AverageX(filter(Table, [project] earlier([project])),[Loop count])

 

If a measure , refer - make is Avg or count

https://community.powerbi.com/t5/Desktop/SUM-of-AVERAGE/td-p/197013

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak thanks for the solution. But it is need working please correct the highligted error
 countx(filter(Table, [project] earlier([project]) && [loop type] = earlier([loop type])),[loop type]).

@harshagraj 

Loop count = countx(filter(Table, [project] =earlier([project]) && [loop type] = earlier([loop type])),[loop type])
Avg Loop =AverageX(filter(Table, [project] =earlier([project])),[Loop count])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
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 Kudoed Authors