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.
I have a requirement to show the last 12 month sales for which the dax used is
Solved! Go to Solution.
Hi, @Avivek
Try to combine this formula into your code:
Year =
IF (
SELECTEDVALUE ( 'Table'[year] = "Current" ),
YEAR ( 'Table'[Date] ) = YEAR ( TODAY () ),
YEAR ( 'Table'[Date] )
)
Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
Hi, @Avivek
Try this:
Last 12 Months =
CALCULATE (
[Sales Amount],
DATESINPERIOD (
'Date'[Date], -- returns period from date column
MAX ( 'Date'[Date] ), -- starting from MAX date
-12, -- shifting it back 12 intervals
MONTH -- each interval being a month
)
)
Did I answer your question? Please Like and Mark my post as a solution if it solves your issue. Thanks.
Appreciate your Kudos !!!
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/
Proud to be a Super User!
Thankyou @ALLUREAN , the measure seems to work in general. But we have few more requirements that needs to be taken into account. We need to have a date slicer which was earlier from To Year table. But it seems the user wants to have a current year slicer instead of the usual To Year slicer. The current year slicer would show the current year by default by that slicer.
But since I have To Year as a filter condition in the measure itself, I am unable to use Current Year column as a slicer for this page. Is there a way to show the current year below like shown in the image without changing anything in the model.
Hi, @Avivek
Try to combine this formula into your code:
Year =
IF (
SELECTEDVALUE ( 'Table'[year] = "Current" ),
YEAR ( 'Table'[Date] ) = YEAR ( TODAY () ),
YEAR ( 'Table'[Date] )
)
Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |