Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Custom Goal / Target on Chart

(0) ShareShare
ReportReport
Posted on by 2,909

Hi,

Struggling here I need to try and create targets / goals based on monthly targets for each Account on a count of Opportunity Products targeting the Model (Segment) attribute of which there are 12. 

Account A has targets of Products grouped by Model (Segment) type

Products (Model 0-40) target 3 units

Products (Model 40-60) target 2 units

…………...

I created the relationships below and have no issue showing a chart of all related Opportunity Products grouped by model on the Account form.

I also created the custom goals entity as shown below however can't see clearly how I can get this as a line on my existing chart mimicking the OOB Goals.

I have attempted creating some OOB rollup queries without success.

I can get the values into a fetchxml query but at a loss, although thinking about count distinct.

5633.Capture5.JPG

Here is the fetch I can get where I can get Segment and related Goal / Target

7608.Capture6.JPG

The FetchXML

<fetch>
  <entity name="opportunityproduct" >
    <attribute name="new_accountid" />
    <attribute name="productid" />
    <attribute name="extendedamount" />
    <attribute name="baseamount" />
    <link-entity name="new_goal" from="new_account" to="new_accountid" link-type="inner" alias="Goal" >
      <attribute name="new_model" />
      <attribute name="new_goal" />
      <attribute name="new_account" />
    </link-entity>
    <link-entity name="account" from="accountid" to="new_accountid" alias="accountOp" />
  </entity>
</fetch>


Any ideas?

*This post is locked for comments

  • Dynamics365 Rocker Profile Picture
    7,755 on at
    RE: Custom Goal / Target on Chart

    It seems like a SSRS report not a chart. Please confirm.

  • antc Profile Picture
    2,909 on at
    RE: Custom Goal / Target on Chart

    Hi Rocker,

    I think this is where my design / logic is flawed as you can see by the screenshot it is returning random model (Ssegment) for same Product which is why I suspect my fetchXML import is failing. I feel like it needs filter conditions with runtime parameters for the linked entity just not sure if this can be done.

    Capture22.JPG

  • Dynamics365 Rocker Profile Picture
    7,755 on at
    RE: Custom Goal / Target on Chart

    Do you have XRM toolbox, If yes then copy paste your below script there and check if it is giving required output.

    <fetch>

     <entity name="opportunityproduct" >

       <attribute name="new_accountid" />

       <attribute name="productid" />

       <attribute name="extendedamount" />

       <attribute name="baseamount" />

       <link-entity name="new_goal" from="new_account" to="new_accountid" link-type="inner" alias="Goal" >

         <attribute name="new_model" />

         <attribute name="new_goal" />

         <attribute name="new_account" />

       </link-entity>

       <link-entity name="account" from="accountid" to="new_accountid" alias="accountOp" />

     </entity>

    </fetch>

    If you do not have XRM toolbox then download it. Thanks

  • antc Profile Picture
    2,909 on at
    RE: Custom Goal / Target on Chart

    I have been trying to create the fetchxml and import but keep getting errors.

    the logic has been to:

    count Opportunity Product quanity

    avg Custom Goal entity goal(int)

    groupby model 

    I'm wondering however if my design is flawed and if there is a better way to achieve this outcome.

    Here is a different concept view if anyone has any ideas.

    3034610.Capture.PNG

  • Suggested answer
    Dynamics365 Rocker Profile Picture
    7,755 on at
    RE: Custom Goal / Target on Chart

    First create OOB then update it's XML as per your need.

  • antc Profile Picture
    2,909 on at
    RE: Custom Goal / Target on Chart

    Yes would like to display on Dashboard and on Account form.

    I believe I can create with OOB chart as I need to edit XML to get the Goals / Target into the FetchXML.

  • Dynamics365 Rocker Profile Picture
    7,755 on at
    RE: Custom Goal / Target on Chart

    Do you want to create OOB chart and want to display in dashboard?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
dkrishna Profile Picture

dkrishna 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans