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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jessicarocha
Helper IV
Helper IV

Calculate average of a measure per 2 filters

I would like to calculate the average of materials ordered in the same day by customers. 

 

I was able to create an average that gives me the number of orders per customer: 

 

Number Materials per order =
CALCULATE(
DISTINCTCOUNT('Fact'[IDNR]), FILTER('Fact', 'Fact'[KDNR ENK]), filter('Fact', 'Fact'[Erstelldatum ENK])
)
 

However, when I try to create the average, it is not working. The measure I used is:

test =
CALCULATE(
AVERAGEX(
Filter('Fact', 'Fact'[KDNR ENK]&& 'Fact'[Erstelldatum ENK].[Date]),
[Number Materials per order]
)
)

 

I created a power bi example with a dummy data that you can find here:
Dummy Power BI 

Thanks in advance for helping me!

 

 

jessicarocha_0-1632203099418.png

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

You may be overengineering this a bit.

 

See attached.

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

I do not know how you arrived at your denominator (7) for your test measure but you can simplify your existing measure to

Number Materials per order = DISTINCTCOUNT('Fact'[IDNR])

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur 

I consider a order the combination from customer and date. Thus, I want to do an average of how many products are sold per order. 
So, it is necessary to count the IDNR per group (customer and date) and then average in the end. 
The 7 comes because I have 7 rows in the table. 7 different combinations of customers and dates. 
@lbendlin achieved that by using summarize and it works! 
so thank you anyway. 

Kind regards, 
Jéssica

lbendlin
Super User
Super User

You may be overengineering this a bit.

 

See attached.

@lbendlin thank you! exactly what I wanted. and much simpler that I was thinking 😄 
I did not know summarize yet. thanks!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.