The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
User | Count |
---|---|
83 | |
83 | |
37 | |
34 | |
32 |
User | Count |
---|---|
92 | |
79 | |
62 | |
53 | |
51 |