Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
97 | |
75 | |
63 | |
62 |
User | Count |
---|---|
143 | |
104 | |
103 | |
82 | |
66 |