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,
I have a date slicer using currdate column in slicer from date table. as per need need to show date slicer as by default date range with start date as "current year first date" and end date as "todays date".
so i am using below measure and applied on date slicer visual filter as 1. i have tried with both measure and calculated column by using below logic but its not working as expected.
Daterange =
VAR currDate =CALCULATE(MIN('DATE'[currDate]),all('DATE'[currDate]))
VAR minidate= (DATE(YEAR(TODAY()),1,1))
VAR enddate = today()
RETURN
IF ( (currDate)>=minidate && (currDate)<=enddate,1,0 )
when i am trying with above meaure not able to show date range as start is current year first date and end date as todays date in date slicer.
also as per need, if i select any other dates and trying to refresh report i am not able to re set the default date range as start is current year first date and end date as todays date.
Please suggest with updated dax/solution or any other approaches.
Thanks in advance for your time and help..
Thanks,
Mahi1827
Solved! Go to Solution.
The updated dax logic is working fine as expected. Thank you so much for your time and suggestions.
Thanks,
Mahi1827
@Mahi1827 , You will not be able to default range .
You can have a column like this in date table and use it (Filter on YTD)
Is Today = if('Date'[Date]<=TODAY() && year('Date'[Date]) = year(TODAY()),"YTD",[Date]&"")
Use relative date slicer : https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range
The updated dax logic is working fine as expected. Thank you so much for your time and suggestions.
Thanks,
Mahi1827
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 | |
80 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |