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 everyone,
I am getting nuts trying to get a measure from the total sales from last year:
Option a) The problem with this one is that is stuck on the current year, so It doesn't change no matter I modify the filter of the year.
**Total Sales Last Year = CALCULATE('PalenciaTotales (2)'[**Total Sales];
('PalenciaTotales (2)'[Año]=YEAR(NOW()-1))
option b) Just doesn't work....
**Total Sales Last Year = CALCULATE('PalenciaTotales (2)'[**Total Sales];
('PalenciaTotales (2)'[Año]-1))
Also I didn' have any luck with PREVIOUSYEAR formula,
Any kind of help is fully appreciated,
thanks!!
Solved! Go to Solution.
If you build a Date dimension table and mark it as Date Table then you can take full advantage of the Time Intelligence formulas in DAX.
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
Hi @okusai3000
It seems you may check your formula PalenciaTotales (2)'[Año]=YEAR(NOW())-1.
Regards,
Cherie
Hi Cherie,
The problem with NOW function, is that it's not affected by filters. This way, if you select for example, 2005 as main year, it will still be showing you 2017. (2018-1)
Hi @okusai3000
You may use SELECTEDVALUE Function when there is a filter. Sample data and expected output will be helpful to provide an accurate solution.
Regards,
Cherie
See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
If you build a Date dimension table and mark it as Date Table then you can take full advantage of the Time Intelligence formulas in DAX.
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
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 |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |