Automatically add one year to date column when item is created - sharepoint-2013

I have a date column where I want it to automatically populate with the date from today plus 1 year.
For example, if the todays date is 31 august 2020 the value of the date column will be set 31 august 2021.
What is the calculating value for the above?

=DATE(YEAR([Date])+1,MONTH([Date]),DAY([Date]))
Try this.
Here [Date] is the date Sharepoint column
https://learn.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/bb862071(v=office.14)

The formula of calculated value should be this:
=DATE(YEAR(Today)+1,MONTH(Today),DAY(Today))

Related

Showing October 2020 as Oct 2020 on the X axis of PowerBI Chart

I have a PowerBI Chart that I am working on for which. I got the Bars Chart on the X axis and the value for each bar in the chart is Month and Year. It is showing full months name like October 2020 but my business user wants to see OCT 2020 instead of October 2020.
Please help me how to change it
Thanks
Go to Transform data and add a column to your table with the following formula
your_new_shortname = Format (Table[Date], "mmm")
Use this new column in your visualization.
Add a calculated column on your date table and set its Sort By Column.

Relative date filter on calendar week not calculating last date of the latest week correctly

I have date dimension table and sales fact table.
Created a chart visual with date week on x axis and values as sum of salesamt.
In the filter pane added relative filter to the date. In the last 4 calendar weeks.
I have a measure that shows LASTDATE(DateTable[Date]) also on the report.
The last date is showing as 6 Feb 2021 (Saturday)
Same value when I select the latest week on x axis.
However when I choose any prior week on x axis, then the last date value is Sunday 31 Jan 2021.
Why does the current week last date show as 6th Jan 2021 (saturday) instead of 7th Jan 2021 (sunday)?
Currently, calendar week is defined Sunday to Saturday when it comes to filtering using relative dates. You can work around it by introducing additional column (basically date - 1 day) and set your relative filter on that.

Filter table based on a specific date plus 7 days

I have a table containing a date field (from 1 March 2020 to now) that I need to filter to a specific date and the previous 6 days to give complete week's data. So if I chose 30 March I'd get a table of 24 March to 30 March. If I then chose 31 March the table would show 25 March to 31 March.
I can use a date slicer to choose a range of dates but I want to be able to pick a single date, with Power BI automatically selecting the earlier date.
Any pointers much appreciated.
Mark.
You can create two measure - one for Slicer selected date and Another one with 7 day minus from the selected date as below-
Considering your date table name is- Dates
selected_date = SELECTEDVALUE(Dates[Date])
seven_day_starts_from = DATEADD(Dates[Date],-7,DAY)
Now create your calculated measure first like-
total_sales = SUM(Sales[sale])
Here comes how you will always calculate last 7 days sales considering the selected date in the slicer-
7_day_sales =
(
CALCULATE(
[total_sales],
DATESBETWEEN(
'Dates'[Date],
[seven_day_starts_from],
[selected_date]
)
) + 0
)
Remember, this is just a sample flow showing how it should work. You should try to follow the steps with your data and table structure. Dates table is a calendar table and Sales table is connected to the Dates table using the Date column.

How to filter YTD to last complete month in Power BI

I am creating a report with buttons that use a slicer to show the last 3 calendar months, the default view, and YTD. The first two are all set and will continue to work fine, however i am having trouble with the YTD filter because i need it to exclude the current month (some of the key metrics for this slicer are only accurate monthly, even thought the data is updated Daily). Any idea how to accomplish this without me having to manually change it every month? An example of it working today would show me 2020 through August, since September is not complete. September would be included in the filter starting October first. I am thankful for your help/insights!
I typically build a calculated column on my date table called something like "Date in Range", that looks something like the below. You could also apply this to a date in a normal table if you are not using a date dimension.
Date in Range = IF ('MyTable'[Date] <
DATEADD(TODAY(), -1 * DAY(TODAY()), day),
1,
0)
This compares the date in the table row with TODAY(), e.g. 14 Sep 2020, minus the day of the month of today (14), effectively getting you back to the start of the current month. This will then return 1 for dates before the end of last month or 0. Filter on 1 or 0 to get your result (or use something more meaningful in place of the 1 or 0).

Calculated Column to get previous year

I have a Date table and I want to create a calculated column that gives me the date of the previous year. For example, if the date is 2018 then Previous_Year column should be 2017.
Current Column is [_Year]
New Calculated Column is [Previous_Year]
In Dax this is what I have [Previous_Year]= DATE(YEAR([_Year]-1,YEAR))
thanks
Try something like this:
Previous_Year = YEAR('Datetable'[_Year])-1)
I am presuming that [_Year] holds a datevalue and that you want the year of that date minus 1.