Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
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 |
---|---|
9 | |
8 | |
5 | |
4 | |
3 |