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
cyberninja
Regular Visitor

Determine average quote amount for a sales opportunity

Pardon me, I am just getting started with Power BI.  

All within the same table, I have an OrderQuoteID which is unique.  Some OpportunityIds have multiple quotes underneath each.  I would like to total the Quote Amounts for a particular Opportunity, then divide by the number of quotes for that Opportunity, so I can determine what the average quote is for every Opportunity.  Data example below -

 

This is what I have now -

Table: vSummaryQuote

Quot_OrderQuoteIDOppo_OpportunityIdQuot_isquoteQuot_Amount
11111111000
21111111500
32222215000
433333110000
5444441100
6444441200
7444441300

 

Based on the data above, I would need to be able to return a column similar to below to make a simple bar graph -

Oppo_OpportunityIdAvgQuotePerOpportunity
111111250
222225000
3333310000
44444200

 

Thoughts on how I can accomplish this?

 

Much thanks!

1 ACCEPTED SOLUTION

Hi @cyberninja,

Using AVERAGE function is not efficient. Because AVERAGE function calculates the arithmetic mean of the numbers in the column itself. In your scenario, you want to get average quote for every Opportunity based on Quot_isquote and Quote Amounts, there are in different columns.

You should create the measures to calculate the count of Quotes, the sum of amount. Then calculate average for every Opportunity as follows.

 

Count = CALCULATE(COUNT(Test1[Quot_isquote]),ALLEXCEPT(Test1,Test1[Oppo_OpportunityId]))
Total amonut = CALCULATE(SUM(Test1[Quot_Amount]),ALLEXCEPT(Test1,Test1[Oppo_OpportunityId]))
Average1 = CALCULATE(SUM(Test1[Quot_Amount]),ALLEXCEPT(Test1,Test1[Oppo_OpportunityId]))/CALCULATE(COUNT(Test1[Quot_isquote]),ALLEXCEPT(Test1,Test1[Oppo_OpportunityId]))

 

Create a table, select the Opportunity and measure as values, you will get the desired result.

1.png

 

Finally, you create a Clustered column chart, select the OpportunityId as Axis, the Average1 as Value level. You will get a simple bar graph.

2.png

 

If you have any question, please feel free to ask.

Best Regards,
Angelia

View solution in original post

2 REPLIES 2
cyberninja
Regular Visitor

To re-phrase my question, would it be sufficient to use the AVERAGE function within the context of a particular OpportunityID?  How might I accomplish this?  thx

Hi @cyberninja,

Using AVERAGE function is not efficient. Because AVERAGE function calculates the arithmetic mean of the numbers in the column itself. In your scenario, you want to get average quote for every Opportunity based on Quot_isquote and Quote Amounts, there are in different columns.

You should create the measures to calculate the count of Quotes, the sum of amount. Then calculate average for every Opportunity as follows.

 

Count = CALCULATE(COUNT(Test1[Quot_isquote]),ALLEXCEPT(Test1,Test1[Oppo_OpportunityId]))
Total amonut = CALCULATE(SUM(Test1[Quot_Amount]),ALLEXCEPT(Test1,Test1[Oppo_OpportunityId]))
Average1 = CALCULATE(SUM(Test1[Quot_Amount]),ALLEXCEPT(Test1,Test1[Oppo_OpportunityId]))/CALCULATE(COUNT(Test1[Quot_isquote]),ALLEXCEPT(Test1,Test1[Oppo_OpportunityId]))

 

Create a table, select the Opportunity and measure as values, you will get the desired result.

1.png

 

Finally, you create a Clustered column chart, select the OpportunityId as Axis, the Average1 as Value level. You will get a simple bar graph.

2.png

 

If you have any question, please feel free to ask.

Best Regards,
Angelia

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.