Tutorial 3 - Weekly insight on revenue target achieved
You'll need either a trial environment or a sandbox environment with Sales Insights to complete these tutorials.
Objective
To create a revenue insight, which shows up each week on the dashboard for all users.
Step 1: Set a weekly recurrence trigger for the flow
Let's choose the same trigger as before, but this time, tweak the values to make it run once a week.
Step 2: Get all users in the org
Let's also use the same action as before to get the list of users from your Dynamics 365 organization.
Now for each user we'll get the opportunities they own and compute the total revenue obtained for all opportunities closed in the last week.
To do this step, we need to add a new action, such as List records and fetch the opportunities.
We use two additional columns in this case:
Aggregation transformation: Used to add the revenue for all the opportunities returned. We use aggregate(actualvalue with sum as actualvalue).
Filter query: Provides the capability to filter out some of the data based on some conditions. In our case, we want to get the opportunities closed in the last week and owned by the current user. The condition is a mix of text, expressions, and dynamic content as in the earlier examples:
actualclosedate le ***expression1*** and actualclosedate ge ***expression2*** and \_ownerid\_value eq ***dynamicContent***
In this example, we're using the following values:
expression1 as utcNow()
expression2 as addDays(utcNow(), -7)
dynamicContent as User
Step 3: Create the insights card
Let's create the card, Select Add an action, and add the Create card for assistant action. Fill in the required values.
Need help? Reach out to us via our community forums.