cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
sixtoquiles Regular Visitor
Regular Visitor

Sales for this year and last year

HI I need to a solution, I wanna to count how record are from january-2016 to today() minus one year.

 

Example:

Today-1year = 8/11/2016

 

Count record from 1/1/2016 to 8/11/2016

2 REPLIES 2
Super User
Super User

Re: Sales for this year and last year

Hi @sixtoquilles,

Add this measure

PY = TOTALYTD ( COUNT(Table[Record]), Dateadd(Today(), -1,YEAR)

If you want to make the date based on a date in a column replace the TODAY() bt that column name.

Regards,
MFelix


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




mattbrice Senior Member
Senior Member

Re: Sales for this year and last year


@MFelix wrote:
@Hi @sixtoquilles,

Add this measure

PY = TOTALYTD ( COUNT(Table[Record]), Dateadd(Today(), -1,YEAR)

If you want to make the date based on a date in a column replace the TODAY() bt that column name.

Regards,
MFelix

Sorry, but I dont' think the above will work as both 'DATEADD' and 'TOTALYTD' require an actual column reference.

 

If you have a best practice 'Calendar' table you can do this:

 

PY =
TOTALYTD ( COUNT ( Table[Column] ), SAMEPERIODLASTYEAR ( Calendar[Date] ) )

 

 

Helpful resources

Announcements
New Kudos Received Badges Coming

New Kudos Received Badges Coming

Kudos to you if you earned one of these! Check your inbox for a notification.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Kudoed Authors (Last 30 Days)
Users online (3,563)