Start Date should be todays date and end date should be todays date plus one month - powerbi

I have a requirement, Ii have date slicer i have created the date dimension
Start Date = CALENDAR (DATE ( 1900,1, 1), DATE (2025,12, 31))
Now I have kept the slicer for this it shows like this 1/1/1900 - 12/31/2025
but the end user want to see the start date with default todays date i.e. 01/02/2019 start date & end date.JPG
and end date should show as 02/02/2019 instead of 12/31/2025.
Can anybody suggest me how can I approach this requirement?

Not quite sure what you're after.
If you're asking for to set a default value for a slicer, that's not possible yet. Upvote this at: Slicer default selected values
Also, when you're using DATES, please use the right syntax, for example:
dd.MM.yyyy
yyyy.MM.dd
Other relevant information that could solve what I think you're after: https://www.fourmoo.com/2017/10/03/power-bi-did-you-know-all-power-bi-services-servers-are-in-utc-now-how-to-handle-it-for-dates-times/

Related

How to sort week end date in the date table in Power BI?

I am new to Power BI, having below date table
Created Week end date using below dax measure
Week End Date = 'Date'[Date] - WEEKDAY('Date'[Date],2) + 7
Can anyone advise the following?
How to sort the week end date? I created bar graph week end date vs Total hrs(which comes from other table) and it's working. However, axis week end data is not in proper order
How to format week end date into "MM/dd/YYYY" (Currently in "dd/MM/yyyy")
Sorry if this question is too basic. I tried various posts but no luck.
You cut your bar chart screenshot exactly on the ellipsis menu (...) in the upper right corner. This is usually the place to go and change the sort order of your x-axis. (Maybe your data doesn't allow this, but then you would need to post some sample data - no screenshot - as already requested above.)
To change the format to "MM/dd/YYYY" use
End of Week US = FORMAT('Table'[End Of Week], "MM/dd/yyyy")

How to automatically update Slicer in Power Bi to Today's Date

I am having a power Bi Report which has a slicer the date column is coming from SQL.
I have Current months Dates till 28-june-2022 and Last years dates in Sql till 30 June 2021
I want only Values to be displayed for todays date in the 2021 Slicer and not all the dates till 30
Screenshot of the Slicer is below
I don't want the Yellow Dates I want the dates to get added automatically when i refresh the other day.
I can do this manually with a filter which is not feasible
If I understand your question correctly, you only want a list of dates within the date range of today and last-year's today. That is the same as the last 12 months of dates. You can do this in the filter pane:
Be sure to un-check the 'Include Today' option.
Another option to select a list of dates between any set of dates is with a measure. Use the following measure to define whatever range of dates you would like. I have done the last full year of dates as an example:
DAX_Dates =
CALCULATE(COUNT('Date'[Date]) --Counts number of records
,KEEPFILTERS( --Allows the filter context of the visuals to dynamically evaluate the calculation
DATESBETWEEN('Date'[Date] --Defines a range of dates to apply the calculation
,DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY())) --Start Date
,TODAY() --End Date
)
)
)
Next, you can filter the visual with the measure.

Dax TotalYTD and SamePeriodLastYear Not working

Hi I am trying to get total YTD amount for last year.
When I select October 2020 my current YTD amount works here is what it looks like :
YTDAmount = TOTALYTD(sum(PCSReport[PD]),PCSReport[PCSMonth])
However, I want to show YTD October 2019 and for some reason it is showing blank. This is the DAX I made :
LYTDAmount = TOTALYTD(sum(PCSReport[PD]), SAMEPERIODLASTYEAR(PCSReport[PCSMonth]) )
Since your calculations are correct, here is what might be the problem.
To work with time intelligence functions (TOTALYTD,DATESYTD ... ) you must have at leat one date table with an active relationship to your fact table.
A date table is a table that meets the following requirements:
It must have a column of data type date (or date/time)—known as the date column.
The date column must contain unique values.
The date column must not contain BLANKs.
The date column must not have any missing dates.
The date column must span full years. A year isn't necessarily a calendar year (January-December).
The date table must be marked as a date table.

Power BI Dax Expression Help - Setting default slicer between dates

Power Bi report uses a date slicer (between) - As a default I want it to set the first date in the slicer as Monday (last week) and the last date as Friday (last week). I dont want this to be a relative date but always must be the previous Mon-Fri. I have a column in my data set that tells me which one is the 'Previous Week' as a text field. I dont know how to use this to set a default slicer value. But i also want to make sure the user can change the slicer dates and it changes as per the user request.
Example today is 01/09/2020
I want my default slicer date as : 24/08/2020 - 28/08/2020
I have two measures which gives me by last week dates:
DefaultSD = MINX( FILTER(Data, [WeeksFilter] = "Previous Week Only"),[Date])
DefaultED = MAXX( FILTER(Data, [WeeksFilter] = "Previous Week Only"),[Date])
I assume this is possible using a DAX expression but dont know how to create this expression to populate these default values.
Please note the data is refreshed up until 01/09/2020 so there is currently data for this week but i dont want this to included in the default slicer on report load
You can't set slicer defaults yet but this can be achieved with relative date filtering.
Select date in the last 1 calendar week:

How to MTD, YTD in Apache Superset?

I would like to create a dashboard with month to date (MTD) and year to date (YTD) charts. However, I do not want to update my date range each month. A fixed date range would do this. Choosing 1 months ago give the last 30days. Using last month gives me last month and everything from this month. Yet, this month is not supported. MTD doesn't work either. I am using Superset version 0.24.0
I figured it out! Use 1st for MTD and Jan 1st for YTD.
For newer versions of Superset, this quarter is supported for quarter to date (QTD) charts.
I think it can be set on the custom tab of the time range in the chart explorer. There you can use 1st and Jan 1st as strings that are parsed.
TO get MTD put 1st in the 'Start' field and put this month in the 'end' field
Select Range Type as "Advanced", then enter "1st" for Start Date and leave End Date blank. Image has today's date as End Date but leave it blank to get YTD
TIME RANGE dialog showing YTD entries