- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Average based on criteria from another column
Hi,
I have some information in CSV and wants to do calculations based on criteria (an average of output if ID's are the same)
In Excel à Column A contains "output" column B and C are ID's and in column D is the Excel calculation.
=AVERAGEIF(C:C;B2;A:A)
is the Excel formula in D2
In Power Bi I've tried EARLIER and VLOOKUPS but I don't get the desired result. I think it isn't very difficult, but I cannot find it 😞
Thnx,
Manfred
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Anonymous,
In your resource data, the ID1 and ID2 are same, so you can add any one to the filter. Please create a calculated column using the following formula and get expected result.
AVG = CALCULATE(AVERAGE(Table5[Output]),FILTER(Table5,Table5[ID1]=EARLIER(Table5[ID1])))
If you have any other issue, please feel free to ask.
Best Regards,
Angelia
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Anonymous,
In your resource data, the ID1 and ID2 are same, so you can add any one to the filter. Please create a calculated column using the following formula and get expected result.
AVG = CALCULATE(AVERAGE(Table5[Output]),FILTER(Table5,Table5[ID1]=EARLIER(Table5[ID1])))
If you have any other issue, please feel free to ask.
Best Regards,
Angelia
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Angelia,
Thnx for helping me. This works great and now I know what went wrong.
For the explanation I've created an example in Excel named the column Output. When I import the Excel file it goes fine. Normally I'll do first a SUMX to calculate different columns and then I want to do the earlierformule. SUMX only works with a measure
Your answer works perfect with my question so we close this post and I'll create a new explanation

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
08-20-2024 08:44 AM | |||
08-05-2024 11:21 AM | |||
02-13-2023 09:21 AM | |||
02-02-2024 08:46 AM | |||
03-22-2024 06:48 AM |
User | Count |
---|---|
141 | |
115 | |
84 | |
63 | |
48 |