Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello,
I am trying to calculate previous year's sales with the below sample data. I used the two formulas and didnt get the right answers. I also have a date table from 2018 to 2022 with date and year column.
With the below formula, I am getting blank.
Solved! Go to Solution.
Hi, @powerbiss
Try measuse as below:
Last Year =
CALCULATE (
SUM ( sales[Sales] ),
FILTER ( 'sales', YEAR ( sales[Date] ) = YEAR ( TODAY () ) - 1 )
)
Best Regards,
Community Support Team _ Eason
Did you link your date table to the sales table ?
Hi James,
Yes created a relationship between Date table and Sales table. Did you get 1600
Thanks
Hi, @powerbiss
Try measuse as below:
Last Year =
CALCULATE (
SUM ( sales[Sales] ),
FILTER ( 'sales', YEAR ( sales[Date] ) = YEAR ( TODAY () ) - 1 )
)
Best Regards,
Community Support Team _ Eason
Thank you v-easonf. Worked great. Really appreciate your help
the table Feuil5
Measure#1 ==>
Hi James,
That worked for me. Thanks for your help
First measure
Sales=CALCULATE(SUM(sales[Sales])
second measure ==>
Sales PY=Calculate([Sales],SAMEPERIODELASTYEAR(Date[date])
Hi James,
I am still get 6600 instead of 1600
User | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |