DAX Average

Michnia25

New Member
Joined
May 31, 2015
Messages
38
Hi,
I am new to Power BI, so I apologize if the question is trivial.
I try to run the Average formula, but the outcome percentage is not right, due to a duplicate line, is there any way to avoid that issue?
I need a formula to first calculate the average for the particular line and then the average of the total.

I will appreciate the support.

1667309197212.png


Kamil
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
In Power Query:

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    tbl = Table.Group(Source, {"Item"}, {{"Avg", each List.Average([Pct]), type number}}),
    rcd1 = [Item = "Average by Item", Pct = List.Average(tbl[Avg])],
    rcd2 = [Item = "Average All", Pct = List.Average(Source[Pct])],
    tbl1 = Table.FromRecords(Table.ToRecords(Source) & {rcd1} & {rcd2}),
    Result = Table.TransformColumnTypes(tbl1,{{"Pct", Percentage.Type}})
in
    Result

PQ Average by item.xlsx
ABCDEF
1ItemPctItemPct
2124%124%
3129%129%
4267%267%
5384%384%
6461%461%
7478%478%
8591%591%
9659%659%
10Average by Item66%
11Average All62%
12
Sheet1
 
Upvote 0

Forum statistics

Threads
1,223,993
Messages
6,175,838
Members
452,675
Latest member
duongtruc1610

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top