• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Calculating Average in Power Bi

ridwanr

New Member
Hi,

Please could you kindly assist with the below.

I would like to calculate the Average value of a country Spain and Portugal. (This product is in multiple rows within my workbook). When i calculate the average it gives me the total average of all the rows combined and not the single average Value. Please see below my formula, what can i do to tweek it so it provides a single units average.

Average = CALCULATE(AVERAGE(Sheet1[Percentage]),FILTER(Sheet1,Sheet1[Country] = "Spain" && Sheet1[Country] = "Portugal"))


Pls see attached Excel file for example since its not allowing to attached Power bi file.

Thanking you in advance for you help.

Regards,
Ridwan
 

Attachments

  • Book1 Average.xlsx
    8.9 KB · Views: 2
You can add a zip file (that contains the PBI-file).
80203

The calculation will always use the pivots' coordinated fields as the initial filter context. I guess that's what you see.
Not clear if you are using a measure or a calculated column.
 
Not sure if it's something like this you are after?
80206
=CALCULATE([avgPct];all(Table1);KEEPFILTERS(table1[Country]="Portugal" || Table1[Country]="Spain"))

Or is it simply:
80207
 

Attachments

  • Book1 Average.xlsx
    114.4 KB · Views: 1
Back
Top