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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Nilrem
Frequent Visitor

Average calculation for distinct orders

How can I calculate average to take only once an order number [Transport No.]?

 

Example:

Transport No.    MAX PCT
AAA                   80
BCA                   75
AAA                   80
CAD                  60
BCA                  75
GHA                 68
AGH                 77
AAA                 80

 

I would like to filter out from the calculation the redundant order numbers (use them onec only for the calculation). The following doesn't work:

 

Avarage Max PCT = CALCULATE(AVERAGE(SLF_MAIN[MAX PCT]);DISTINCT(SLF_MAIN[Transport No.]))

 

 

1 ACCEPTED SOLUTION

Hi Angelia,

 

Thank you for your hints. I think the solution will be:

1) Query editor -> Manage -> Duplicate

2)Right click on the column in the new table -> Remove duplicates

 

I think it will be automatic solution.

 

View solution in original post

6 REPLIES 6
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @Nilrem,

You can right click your table->Edit Quey, right column header->Remove Duplicates, you will get distinct row table as follows.

1.PNG

Then you create a meaasure to get the expected result.

Avarage Max PCT = Average(Table[Max PCT])

Best Regards,
Angelia

Thank you for your answer. Unfortunately I have to keep that records. How can I create an other table automaticaly which will contain only unique records?

Hi

Assume that you need to keep the original table without creating a new one. 

What would be the correct filter to apply on column Transport No. ?

thanks

Hi @Nilrem,

Please create a new table by clicking "New Table" under Modeling on home page. Please type the following formula, you will get distinct table.

NewTable = DISTINCT(Table1)


2.PNG

Then calculate the average based on the new table.

Best Regards,
Angelia

Hi Angelia,

 

Thank you for your hints. I think the solution will be:

1) Query editor -> Manage -> Duplicate

2)Right click on the column in the new table -> Remove duplicates

 

I think it will be automatic solution.

 

Hi @Nilrem,

Congratulations, you have resolved your issue by yourself. Please mark your solution as answer, so that more people will find the workaround easily. 

Thanks,
Angelia

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.