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
Anonymous
Not applicable

Help to find DAX to Average Vlookup Value Across Multiple Rows With Same Unique Identifier

Hello,

So, I'm trying to figure out a DAX that will take the Lookup (Vlookup) value and average across multiple rows (part numbers), based on the count of rows with a unique identifier (Document #). I'm thinking it should be the LOOKUP value divided by the COUNTIF function, but not sure...can someone provide some insight on how to properly do this? 

 

In the below screen shot example you can see, Document #7374 has 3 different "WOMP Tag #" these are part numbers created on each Document. However, on the far right Vlookup Costs & Vlookup Hrs are allocating the totals for that Document 3 different times. I need the totals averaged by 3 or by sum of rows counted with same Document #. 

 

Capture.PNG

 

Regards,

Kyle

2 REPLIES 2
dedelman_clng
Community Champion
Community Champion

Hi @Anonymous -

 

Based on what you described, I think you can use something like AVERAGEX

 

VLookup_Avg =
AVERAGEX (
    VALUES ( '2021 Production'[Document #] ),
    '2021 Production'[Vlookup No]
)

 

Without having your data I wasn't able to test, so see if this gets you were you want to go.

 

Hope this helps

David

Anonymous
Not applicable

Thanks for the input. I actually ended up creating another table and through Power Query Editor replicated a CountIF function to count number of lines for each Document #, then through a lookup formula divided that by total costs & labor hours. Probably not the most efficient way, but everything works now! Examples below...

 

Count Doc# Lines = LOOKUPVALUE ( 'W.O. Qty Table '[Count Part #] , 'W.O. Qty Table '[Document #] , '2021 production'[Document #] , 'W.O. Qty Table '[Document #] , '2021 production'[Document #] )

 

Avg Costs = DIVIDE ( '2021 production'[Vlookup Costs] , '2021 production'[Count Doc# Lines] )
Avg Hrs = DIVIDE ( '2021 production'[Vlookup Hrs] , '2021 production'[Count Doc# Lines] )power bi.PNG

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.