calander
3 TopicsCalculated column if date is within last 7 days using Calendar Dimension
I have two tables. One is a Calendar Dimension the other has values in it. They are linked by an ID, and I need to create a 'flag' to determine whether the value row is in the past 7 days, but I can't seem to get the relationship to work. I tried using USERELATIONSHIP and RELATED and RELATEDTABLE, but maybe I'm unable to get it to work. Calendar Dimension: Id Date 1 01/01/2021 2 02/01/2021 .. .. 4 20/01/2021 5 21/01/2021 Values table: Value DateID InPast7Days 500 1 0 -400 2 0 900 5 1 What i want is to use the relationship, to add the column with the 0's if the date is not within the past 7 days, and 1 if it is within the past 7 days. Hope this makes sense, and that you can help 🙂Solved8.3KViews0likes4CommentsConcatenate Year+Weeknum using dax
Dear experts, I am trying to create a dynamic column consistent of Year+"W"+Weeknum (e.g. 2021W10) which fits the Danish calendar system. However I am running into troubles around the last days of most years. The closest I have come is the following, which works between 18-19 and 19-20, however it creastes problems from year 2021 YearWnum = CONCATENATE(If(WEEKNUM(DateTable[Date],21)-WEEKNUM(DateTable[Date],2) <0, DateTable[Year]+1, DateTable[Year]), DateTable[WeekNum]) Please note the week should start monday and some years have week 53 included (e.g. 2020) Thanks in advance.654Views0likes0CommentsAn argument of function 'DATE' has the wrong data type or the result is too large or too small.
Hi, I'm trying to make an calender where the minimm date is fixed and the max dat is comming from a table startingDate ([datumIngang]) this date in this calander may go to one year afther this date. When i use this ill get an message: An argument of function 'DATE' has the wrong data type or the result is too large or too small. The data type of data is correct. Kalender = ADDCOLUMNS( CALENDAR( DATE(2016, 1, 1) /* startdate */ , DATE(YEAR(MAX(tablename[DatumIngang])) + 1, MONTH(MAX(tablename[DatumIngang])), DAY(MAX(tablename[DatumIngang]))) /* max date + 1 year */ ) , "Jaar" , FORMAT([Date], "YYYY") , "JaarMaand" , FORMAT([Date], "YYYY-MM") , "Maandnummer" , FORMAT([Date], "MM") , "Maand" , FORMAT([Date], "MMMM") )Solved966Views0likes1Comment