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
Applicable88
Impactful Individual
Impactful Individual

Average Distinctcount of orders but disregarding blank values in field of another table

Hello,

I have a typical facttable and a dimension table. My facttable is a order table where I track all orders and from which shelf something was taken:

 

Shelfno OrderID
1234 111111
1235 222222
1236 333333
1237 444444
1238 555555
1239 666666
1240 777777
1241 888888
1242 999999
1243 1111110
1244 1222221

 

My dimension table consist of the details about which material is in the shelf:

 

Shelfno Material
9999  
1240 mmm
1244 nnn
8786  
1236 ggg
1239 ddd
5555  
1234 dhd
3333  
1243 jdj
5563  

 

Both tables are connected via the shelf no. and bidrectional filtering is turned on. 

 

I need the average distinctcount of OrderID of each Shelfno. And also disregard the shelfs with blank Materials.

 

I tried something with Averagex, Addcolumns and Summarize but the problem is that both are in different tables, and I also don't no how to filter out the blank Materials from the counts. 

Thank you very much in advance. 
Best. 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Applicable88 , Try a measure like

AverageX(values(Table2[Shelf]), calculate(distinctcount(Table1[OrderID])))

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

1 REPLY 1
amitchandak
Super User
Super User

@Applicable88 , Try a measure like

AverageX(values(Table2[Shelf]), calculate(distinctcount(Table1[OrderID])))

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
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.

Top Solution Authors