Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Sriku
Helper IV
Helper IV

Calculating average excluding transaction level

Hi Team,

 

I amd new to powerbi. I want to calculate average of customer excluding category Exclusion.PNGlevel details, but, Grouping good/bad should be basis on average sales for cusotmer level.

1 ACCEPTED SOLUTION

Hi @Sriku ,

 

Do you want to create a date slicer to control the number of customer?

If yes, you can add the order data in the slicer and click the date you need.

 

cal1.png

 

If it doesn’t meet your requirement, could you please show us the exact expected result based on the table that you have shared?

It will be helpful if you can show us the exact expected result based on the tables.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

11 REPLIES 11
amitchandak
Super User
Super User

@Sriku , not very clear

 

calculate(sum(Table[value]), filter(Table, Table[category] <>"A1"))

there is average sales calculated in the each transcation level.Average.PNG

Row IDOrder IDOrder DateShip DateShip ModeCustomer IDCustomer NameSegmentCountry/RegionCityStatePostal CodeRegionProduct IDCategorySub-CategoryProduct NameSalesQuantityDiscountProfitAvg SalesH/M/L
1CA-2018-15215611/8/201811/11/2018Second ClassCG-12520Claire GuteConsumerUnited StatesHendersonKentucky42420SouthFUR-BO-10001798FurnitureBookcasesBush Somerset Collection Bookcase261.962041.9136=U2/R2Low
2CA-2018-15215611/8/201811/11/2018Second ClassCG-12520Claire GuteConsumerUnited StatesHendersonKentucky42420SouthFUR-CH-10000454FurnitureChairsHon Deluxe Fabric Upholstered Stacking Chairs, Rounded Back731.9430219.5820.3Low
3CA-2018-1386886/12/20186/16/2018Second ClassDV-13045Darrin Van HuffCorporateUnited StatesLos AngelesCalifornia90036WestOFF-LA-10000240Office SuppliesLabelsSelf-Adhesive Address Labels for Typewriters by Universal14.62206.87140.47Low
4US-2017-10896610/11/201710/18/2017Standard ClassSO-20335Sean O'DonnellConsumerUnited StatesFort LauderdaleFlorida33311SouthFUR-TA-10000577FurnitureTablesBretford CR4500 Series Slim Rectangular Table957.577550.45-383.031-0.4Medium
5US-2017-10896610/11/201710/18/2017Standard ClassSO-20335Sean O'DonnellConsumerUnited StatesFort LauderdaleFlorida33311SouthOFF-ST-10000760Office SuppliesStorageEldon Fold 'N Roll Cart System22.36820.22.51640.1125Low
6CA-2016-1158126/9/20166/14/2016Standard ClassBH-11710Brosina HoffmanConsumerUnited StatesLos AngelesCalifornia90032WestFUR-FU-10001487FurnitureFurnishingsEldon Expressions Wood and Plastic Desk Accessories, Cherry Wood48.867014.16940.29Medium
7CA-2016-1158126/9/20166/14/2016Standard ClassBH-11710Brosina HoffmanConsumerUnited StatesLos AngelesCalifornia90032WestOFF-AR-10002833Office SuppliesArtNewell 3227.28401.96560.27Low
8CA-2016-1158126/9/20166/14/2016Standard ClassBH-11710Brosina HoffmanConsumerUnited StatesLos AngelesCalifornia90032WestTEC-PH-10002275TechnologyPhonesMitel 5320 IP Phone VoIP phone907.15260.290.71520.1Medium
9CA-2016-1158126/9/20166/14/2016Standard ClassBH-11710Brosina HoffmanConsumerUnited StatesLos AngelesCalifornia90032WestOFF-BI-10003910Office SuppliesBindersDXL Angle-View Binders with Locking Rings by Samsill18.50430.25.78250.3125Low
10CA-2016-1158126/9/20166/14/2016Standard ClassBH-11710Brosina HoffmanConsumerUnited StatesLos AngelesCalifornia90032WestOFF-AP-10002892Office SuppliesAppliancesBelkin F5C206VTEL 6 Outlet Surge114.95034.470.3Medium

@Sriku 

Can you provide an example as to how you need the expected results?

Thanks
Fowmy

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

After doing pivot I need to average the average sales. then count how many customer are good or bad.Desired output.PNG

Hi @Sriku ,

 

We can create a good or bad column, then create two measures to meet your requirement.

 

1. Create a good or bad column.

 

Column = 
var _ave = CALCULATE(AVERAGE('Table'[Sales]),FILTER('Table','Table'[Customer Name]=EARLIER('Table'[Customer Name])))
return
IF(
    _ave>=150,"Good","Bad")

 

cal1.jpg

 

2. Then create good count and bad count measures.

 

Good count = 
CALCULATE(DISTINCTCOUNT('Table'[Customer Name]),FILTER('Table','Table'[Column]="Good"))

 

Bad count = 
CALCULATE(DISTINCTCOUNT('Table'[Customer Name]),FILTER('Table','Table'[Column]="Bad"))

 

cal2.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

BTW, pbix as attached.

Thanks for your prompt response. I think you have done almost. I want to count distinct customer falling under Good and bad.

So based on any filter it should show distinct customer as pie chart.

 

Hope this is clear.Exclusion.PNG

Hi @Sriku ,

 

If you want to display the pie chart, there are two ways.

 

The first way is add the two measures in pie chart value.

 

CA1.jpg

 

The second way is add the distinct customer name in value and add the good or bad column in Details.

 

CA2.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

BTW, pbix as attached.

On the summarized table or pie chart if I apply order data/ Ship date to know how many unquie customer are good/bad

Hi @Sriku ,

 

Do you want to create a date slicer to control the number of customer?

If yes, you can add the order data in the slicer and click the date you need.

 

cal1.png

 

If it doesn’t meet your requirement, could you please show us the exact expected result based on the table that you have shared?

It will be helpful if you can show us the exact expected result based on the tables.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Fowmy
Super User
Super User

@Sriku 

How does your source data look like in the table?

Can you share some sample data and the expected result to have a clear understanding of your question?
You can save your files in OneDrive, Google Drive, or any other cloud sharing platforms and share the link here.
____________________________________
How to paste sample data with your question?
How to get your questions answered quickly?

_____________________________________
Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Average.PNG

Row IDOrder IDOrder DateShip DateShip ModeCustomer IDCustomer NameSegmentCountry/RegionCityStatePostal CodeRegionProduct IDCategorySub-CategoryProduct NameSalesQuantityDiscountProfitAvg SalesH/M/L
1CA-2018-15215611/8/201811/11/2018Second ClassCG-12520Claire GuteConsumerUnited StatesHendersonKentucky42420SouthFUR-BO-10001798FurnitureBookcasesBush Somerset Collection Bookcase261.962041.9136=U2/R2Low
2CA-2018-15215611/8/201811/11/2018Second ClassCG-12520Claire GuteConsumerUnited StatesHendersonKentucky42420SouthFUR-CH-10000454FurnitureChairsHon Deluxe Fabric Upholstered Stacking Chairs, Rounded Back731.9430219.5820.3Low
3CA-2018-1386886/12/20186/16/2018Second ClassDV-13045Darrin Van HuffCorporateUnited StatesLos AngelesCalifornia90036WestOFF-LA-10000240Office SuppliesLabelsSelf-Adhesive Address Labels for Typewriters by Universal14.62206.87140.47Low
4US-2017-10896610/11/201710/18/2017Standard ClassSO-20335Sean O'DonnellConsumerUnited StatesFort LauderdaleFlorida33311SouthFUR-TA-10000577FurnitureTablesBretford CR4500 Series Slim Rectangular Table957.577550.45-383.031-0.4Medium
5US-2017-10896610/11/201710/18/2017Standard ClassSO-20335Sean O'DonnellConsumerUnited StatesFort LauderdaleFlorida33311SouthOFF-ST-10000760Office SuppliesStorageEldon Fold 'N Roll Cart System22.36820.22.51640.1125Low
6CA-2016-1158126/9/20166/14/2016Standard ClassBH-11710Brosina HoffmanConsumerUnited StatesLos AngelesCalifornia90032WestFUR-FU-10001487FurnitureFurnishingsEldon Expressions Wood and Plastic Desk Accessories, Cherry Wood48.867014.16940.29Medium
7CA-2016-1158126/9/20166/14/2016Standard ClassBH-11710Brosina HoffmanConsumerUnited StatesLos AngelesCalifornia90032WestOFF-AR-10002833Office SuppliesArtNewell 3227.28401.96560.27Low
8CA-2016-1158126/9/20166/14/2016Standard ClassBH-11710Brosina HoffmanConsumerUnited StatesLos AngelesCalifornia90032WestTEC-PH-10002275TechnologyPhonesMitel 5320 IP Phone VoIP phone907.15260.290.71520.1Medium
9CA-2016-1158126/9/20166/14/2016Standard ClassBH-11710Brosina HoffmanConsumerUnited StatesLos AngelesCalifornia90032WestOFF-BI-10003910Office SuppliesBindersDXL Angle-View Binders with Locking Rings by Samsill18.50430.25.78250.3125Low
10CA-2016-1158126/9/20166/14/2016Standard ClassBH-11710Brosina HoffmanConsumerUnited StatesLos AngelesCalifornia90032WestOFF-AP-10002892Office SuppliesAppliancesBelkin F5C206VTEL 6 Outlet Surge114.95034.470.3Medium

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.