date formatting to number
2 TopicsExtracting Date from Text Field
Hi, I've got a Text field and want to extract a Date from it. My text field has blank values or Date in format "DD/MM/YYYY" or even time like "DD/MM/YYYY Time". I want to extract the date form it in the format DD/MM/YY. I tried this formula ``` Legend = IF (Database[Date Text column]<>BLANK(), IFERROR(DATE(YEAR(Database[Date Text column]),MONTH(Database[Date Text column]),DAY(Database[Date Text column])),BLANK()),BLANK()) //Converting Text field to Date ``` However, this gives the new column as Text as well and I am unable to convert the type to Date. Any suggestions are welcome. Please help!Solved1.4KViews0likes2CommentsHow to format a date calculation to give a number / calculate numbers of days based on slicer
Hello, I am trying with this formula to create a calculation of the days based on the selection in a date slicer (so the count of actual days e.g. if the slicer is set to show the last 60 days, the measure will return the number 60, which I can then use in other calculations). However, I am stuck and nothing is working. I know there is a lot on this topic available, but I have not been able to use any of that info yet. This is the dax measure: DataScore_13-count_days_slicer = VAR FirstDay = CALCULATE( MIN(DIM_DATE_D1[Date]), ALLSELECTED(DIM_DATE_D1[Date]) ) VAR LastDay = CALCULATE( MAX(DIM_DATE_D1[Date]), ALLSELECTED(DIM_DATE_D1[Date]) ) RETURN DATESBETWEEN(DIM_DATE_D1[Date],FirstDay,LastDay) The DIM_DATE_D1[Date] is the date table I am using (corporate date table) What am I doing wrong? So just to be clear, I need a measure that gives me the amount of dates, based on the date slicer settings on my report pages. Cheers, CarstenSolved504Views0likes2Comments