The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I want to get average of each category(the category can be changed with filters)
For example, with the date below,
I want to get the average pallet # by each loading number.
Please advice me that how to get the average by each loading number.
*Condition
1) All pallets with same loading number must be combined
2) All data must be calculated with each loading number.
In excel, I can get the data by converting below data to pivot tabel.
And then, I can get the data by using simple average function.
But, I want to establish it in power bi automatically.
Date | Truck plate # | Loading number | Pallet # |
2022-08-02 | ABCD012 | 1000001 | 3 |
2022-08-02 | ABCD012 | 1000001 | 4 |
2022-08-02 | ABCD012 | 1000001 | 2 |
2022-08-02 | ABCD013 | 1000002 | 1 |
2022-08-02 | ABCD013 | 1000002 | 3 |
2022-08-02 | ABCD013 | 1000002 | 4 |
2022-08-02 | ABCD013 | 1000002 | 5 |
2022-08-02 | ABCD013 | 1000002 | 2 |
2022-08-02 | ABCD013 | 1000002 | 3 |
2022-08-02 | ABCD015 | 1000003 | 4 |
2022-08-02 | ABCD015 | 1000003 | 5 |
2022-08-02 | ABCD015 | 1000003 | 2 |
2022-08-03 | ABCD012 | 1000004 | 3 |
2022-08-03 | ABCD012 | 1000004 | 1 |
2022-08-03 | ABCD012 | 1000004 | 3 |
2022-08-05 | ABCD013 | 1000005 | 3 |
2022-08-05 | ABCD013 | 1000005 | 2 |
2022-08-05 | ABCD013 | 1000005 | 3 |
Many thanks
Solved! Go to Solution.
Hi,
Please check the below picture and the attached pbix file.
Avg pallets by each loading: =
AVERAGEX (
VALUES ( Data[Loading number] ),
CALCULATE ( SUM ( Data[Pallet #] ) )
)
Hi,
Please check the below picture and the attached pbix file.
Avg pallets by each loading: =
AVERAGEX (
VALUES ( Data[Loading number] ),
CALCULATE ( SUM ( Data[Pallet #] ) )
)
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
32 | |
14 | |
10 | |
10 | |
9 |