Set default date range for 2 years in power bi date slicer - powerbi

I have a dataset which is containing data from 2015 to latest and dataset is refreshing on daily basis. So I need to set default start date and end date for 2 years from latest date as by default. But User can also see the previous data by changing the date selection. How can I set the default date range for last 2 years including today?

We can easily perform day, month, year filtering with the slicer option we have selected from the visualisation section.
enter image description here
In the dateadded slicer that we see in the image, we can perform the filtering process we want from the options located in the upper right corner.

Related

How to set last 2 months as default filter in a power bi dashboard

The user when opening the dashboard needs to see the last 2 months filtered with slicer not selected
if user select any date in slicer, then the graphic should be filtered according to the slicer (not only 2 months)
You can use the relative data filter to show the last two months of data on your report. This will track over the time without needing to update the date.
What you can then do if you need the user to put in their own date range it to use a bookmark to remove the date filter to the full date range, which the user can select.
Using two bookmarks one to clear the data range and one to show the last two months. You can layer the bookmarks and control the visuality, and even the slicer type if required.

Change shared axis/hierarchy based on date slicer

I am having some trouble dynamically altering my x-axis based on a custom date slicer.
Basically it works fine if the end-user is looking at every single date between 2020 and 2021, however, if the end-user filters to just a couple months, I want the column chart to skip the Year and just jump to the MonthYear axis to remove the user having to start from the year then drill down to see the months.
Similarly, if it was just days filtered in the slicer it should jump to the Date axis rather than drilling down from Year then to MonthYear then finally to Date.
How would I go about doing this?
Date Slicer:
Stacked Column Chart:
Shared Axis:

How to filter dates 2 days before today

Table has a column with dates. I am showing this data with Table visualization. I need to filter the date to always show dates that are 2 days before from now. For example today is 22.04.2020 and I need to filter it so it would automatically show only data with dates 2 days before like 20.04.2020 as a max date. In SQL I use codeDATEADD(DAY, -1, #today)
Since I'm using direct query then I can't make changes to the date table in query manager ( It needs to be updated every 15 minutes )
How can I do that in Power BI visualization?
Very simple, use relative filtering.
You can define it as a slicer, a hidden slicer or in the filter panel.

Power BI Desktop - Relative Date Slicer Defaulting to Days

Hoping this is a simple one to resolve.
I have a dataset, a SQL View, with the data imported into my PBIX. I have a date slicer and a number of tables, matrices and charts, over 2 pages. All update whenever I change my slicer, great.
One of my charts needs to show the last 12 months only. I choose Relative Date Filtering from the Visual level filters, select "is in the last", 12 and months from the various drop-downs. When I click Apply filter, my chart goes blank, even though there is data. When I click off the chart and back on again, the drop-down has changed to Days, not months. I have tried with various different options and always defaults back to days.
My Date field is definitely a Date. I have also tried adding a Date table and using that date too but the same thing happens.
Is it me or is there a bug?
Thanks

How to create Trailing 12 month date parameter in Power BI

Is it possible to create trailing 12 month date parameter? I want to be able to choose Month-Year, so it display data till the end of that chosen Month-Year 12 months back.
Something like that on a picture below.
Do I need to create some date measures for that?
Thanks
I would use the Relative Date slicer & filter feature built into Power BI. It can cater to that requirements E.g. Last - 12 - Months (Calendar)
https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-slicer-filter-date-range/
No modeling preparation is needed - it is set in the report page design.