cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper III

## Last year to date sales

Hii..

I have a requirement to calculate last year sales i.e if today date is 19/oct/2019 i need the last year sales from 01/Jan/2018 to 19/Oct/2018

I have used

SAMEPERIODLASTYEAR,
PARALLELPERIOD,dateadd functions but all the functions is not satisfying my requirement....
all the functions are returning the sales from 01/Jan/2018 and 31/Oct/2018
is there any way to do this??

Thanks
1 ACCEPTED SOLUTION
Super User

It would certainly help if you show a sample of your tables. Assuming you are looking for a measure, try this in a card visual:

Measure =
VAR First_ =
DATE ( YEAR ( TODAY () ) - 1; 1; 1 )
VAR Last_ =
EDATE ( TODAY (); -12 )
RETURN
CALCULATE (
SUM ( Table1[Sales] );
Table1[Date] >= First_;
Table1[Date] <= Last_
)

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers

Super User

It would certainly help if you show a sample of your tables. Assuming you are looking for a measure, try this in a card visual:

Measure =
VAR First_ =
DATE ( YEAR ( TODAY () ) - 1; 1; 1 )
VAR Last_ =
EDATE ( TODAY (); -12 )
RETURN
CALCULATE (
SUM ( Table1[Sales] );
Table1[Date] >= First_;
Table1[Date] <= Last_
)

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### Fabric Community Update - June 2024

Find out what's new and trending in the Fabric Community.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors