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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to create function max(date) in SSRS Report?

(0) ShareShare
ReportReport
Posted on by 3,805

Hi all..

i try create report.

i just select field LineNum, Name, Date, Amount in myTable.

and this is output in my report.

3531.1.jpg

But, i want output report like this.

if maximum date, value for Amount in column Amount A is null and move in column Amount B.

4606.2.jpg

max(date) in number 3, and amount move to column Amount B from Amount A.

only max(date).

Can i do it use function iif in SSRS Report.

if i can, How?

Thanks all.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mea_ Profile Picture
    60,286 on at

    You can do something like this:

    In expression of column B =iif(Max(Fields!Date.Value) = Fields!Date.Value, Fields!Amount.Value, 0)

    In expression of column A =iif(Max(Fields!Date.Value) = Fields!Date.Value, 0, Fields!Amount.Value)

  • Verified answer
    Sohaib Cheema Profile Picture
    49,668 Super User 2026 Season 1 on at

    Hi PIL,

    I don't think of this working, without specifying DataSet Name. I cannot see max value to return something valuable without mentioning name of dataset.

    Try following

    For column A of amount:-

    =IIF(Fields!TransDate.Value = (Max(Fields!TransDate.Value, "NameOfSSRSDataSet")),0,Fields!AmountA.Value)

    For Column B of amount :-

    =IIF(Fields!TransDate.Value = (Max(Fields!TransDate.Value, "NameOfSSRSDataSet")),Fields!AmountA.Value,0)

  • Mea_ Profile Picture
    60,286 on at

    @Sohaib

    Did you try to use it without second parameter ?

    Because it is a scope and it's optional. If you won't specify a scope SSRS will use default and default scope should be data source of the tablix here....

  • Sohaib Cheema Profile Picture
    49,668 Super User 2026 Season 1 on at

    Hi ievgen,

    Yes, I tried with single parameter, unfortunately it did not gave required result.

    I would give another try to use code suggested by you. I will share results :)

  • fajar Profile Picture
    3,805 on at

    Thank Sohaib Cheema..

  • fajar Profile Picture
    3,805 on at

    Hi,

    can you help me again.
    i have problem again in my report.
    please follow this link.

    https://community.dynamics.com/ax/f/33/t/202563

    Thanks.

    [View:https://community.dynamics.com/ax/f/33/t/202563:750:50]

  • Sohaib Cheema Profile Picture
    49,668 Super User 2026 Season 1 on at

    Hi PIL,

    Thank you for your question. Well, I cannot say any words without doing my TESTING for your 2nd Question.

    You may stay connected with your new thread unless you get any replies.

  • fajar Profile Picture
    3,805 on at

    Yes, thanks Sohaib for your respond.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 21

#2
dserp Profile Picture

dserp 4

#2
dekion Profile Picture

dekion 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans