web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Dynamics 365 Fetchxml ssrs report Issue

(0) ShareShare
ReportReport
Posted on by 170

Hi Everyone,

I am working on FetchXML based SSRS reports and stuck with how to proceed with the issue. I have an entity called opportunity and it is 1:N relationship with forecasts.  1 opportunity can have multiple forecast records. I need to do a SSRS report to display some fields from opportunity and SUM from related forecast records based on dates. 

So the report columns looks like this and it is grouped by opportunityid to show only 1 for each opportunity. 

Opportunity ID, Estimated Revenue, Created On, Forecast This Month, Forecast next 3 months, Forecast Next 6 Months and so on

I have written a fetch XML query to retrieve opportunity and its related forecast records. 

I did to find a SUM of forecast records between two dates but it shows 0 as a result. Please see below. I have tried different expressions but it does not work. Please see the expressions I am using as below

 =SUM(IIF(((Fields!ad_new_forecastdate.Value)>(DateAdd("d",-(Day(today)-1), Today))And((Fields!ad_new_forecastdate.Value)<((DateAdd("d",-(Day(today)-1), Today)).AddMonths(3))),0)),"opportunityid")

=IIF(((Fields!ad_new_forecastdate.Value)>(today))And((Fields!ad_new_forecastdate.Value)<(today.AddMonths(3))),Sum(Fields!ad_new_actualtotalValue.Value),0)

Can someone point to correct way of doing this and correct filter expression?

Thanks and Regards

Nemath

I have the same question (0)
  • David Jennaway Profile Picture
    14,065 on at
    RE: Dynamics 365 Fetchxml ssrs report Issue

    The general approach should be as per the first expression - i.e. the Sum function should be in the outside. From what I can see, the first expression is summing a 0, rather than any other field

    If may help to break the different parts of the expression into separate calculated fields, and display each while you test it

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 149

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 142

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 125 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans