Forum Discussion
show value based on current date
- 6 years ago
HI Anonymous
If so, just adjust the formula as below:
Measure 2 = var _preworkingdatekey= calculate(max('Date'[PreviousWorkingDate]),filter('Date','Date'[DateValue] = today())) return DATE(VALUE(LEFT(_preworkingdatekey,4)),VALUE(MID(_preworkingdatekey,5,2)),VALUE(RIGHT(_preworkingdatekey,2)))Regards,
Lin
Hi Anonymous ,
I'm not sure your data key format, so you can change the format in the below measure to suit your type:
Measure = calculate(max(perviousworkingdatekey),filter(date_table,datekey = today()))
Please try.
Aiolos Zhao
- Anonymous6 years agoNot applicable
it shows (Blank)
- Anonymous6 years agoNot applicable
My previous post saying it shows (Blank) was wrong.
It actually shows 20M whereas it should show a date.
Any thoughts please?Thank you
- Anonymous6 years agoNot applicable
could you please show some sample data and the result you want?
- Anonymous6 years agoNot applicable
sample data
DateKey DateValue PreviousWorkingDate
20140306 2014-03-06 20140305
20140307 2014-03-07 20140306so if today's date is, say, 7th march 2014 then the measure should show the [date value] which represents the [previousworkingDate ]= 20140306
Thank you
- amitchandak6 years ago
Super User
Anonymous , does you date has a timestamp in it , if so create a date column
Date = [Datetime].date
then join it with date table and filter for today.
calculate(sum(Table[value]), filter(Date, Date[Date]=Today()))
Make sure you have data for today
- Anonymous6 years agoNot applicable
Measure =
= calculate(max('Date'[Previous Working Date Key]),filter('Date','Date'[Value] = today()))Previous Working Date key is in integersDate Key is in integersDate Value is in DateThe above measure shows 20M rather than date.Do you know why?Thank you- v-lili6-msft6 years ago
Community Support
HI Anonymous
If so, just adjust the formula as below:
Measure 2 = var _preworkingdatekey= calculate(max('Date'[PreviousWorkingDate]),filter('Date','Date'[DateValue] = today())) return DATE(VALUE(LEFT(_preworkingdatekey,4)),VALUE(MID(_preworkingdatekey,5,2)),VALUE(RIGHT(_preworkingdatekey,2)))Regards,
Lin