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.
Hi,
In the date slicer, From DATE_1 to DATE_2, I want to fix DATE_2 as Today(), the DATE_1 can be customized. I am thinking of adding a new column using DAX by going into Modelling > New Column > DAX:
Hope to receive help from you all.
@yennhi95zz You should be able to do this without a calculated column, but the difference could be due to timezone. What timezone are you in?
Here's the starting how to for the TODAY function https://dax.guide/today/ that will guide you to lots of fantastic resources from SQLBI on handling dates in Power BI.
If you do need to add a column, I recommend adding it in Power Query using M, and convert to UTC time to make the filters work in Power BI service.
https://www.thepoweruser.com/2019/10/21/handling-different-time-zones-in-power-bi-power-query/
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Hihi, thank you for your reply.
I don't get it much. Can you guide more specifically?
Thank you in advance 😄
If the timezone isn't the issue, just:
1) Select the slicer you're pointing to in your screenshot.
2) In the 'Filters on this visual' section, change date slicer to 'Relative date' (it might be set to 'Advanced' or 'Basic')
3) Set to In the last 10 years and be sure to tick 'Include today'
This should do the same thing without needing to create a calculated column and will update unlike the calculated column which will only update if you refilter the slicer.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
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 |
---|---|
107 | |
99 | |
76 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |