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

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
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,516
Messages
6,172,778
Members
452,477
Latest member
DigDug2024

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