How to MTD, YTD in Apache Superset? - 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

Related

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.

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).

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

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/

Power BI - filter data to current week (week number)

I have a power bi report with a line chart that has a field called 'EventDate'
I need to add a filter on to this report to say 'only get me the days where the EventDate matches this week number'
I don't want to display the last 7 days as a relative filter.
I need to do it by this week.
Can anyone help
You can use the week in the relative date filtering and it returns the dates associated with the current week number rather than the last 7 days.

previous sunday date in informatica

I've a requirement where I need to compare a column date with current date. If my column date > last sunday's date I need to populate a status. Here, am facing issues in calculating present week's sunday date.
I need to calculate Previous Sunday's date in Informatica expression transformation.
I am not exactly sure about your requirement, however, you can always get the day and based on that subtract a fixed number of days to reach any sunday you want (present week or previous week). You should have a limited (7) set of IIF statements to achieve this.
Eg. If the day is 'Tuesday' (day of the current date) then subtract 2 from the date to get sunday date!
You can write an expression as- trunc(sysdate,'d') in a variable port which is having datatype as date.
The expression would return the Sunday date of the current date. Then you can compare the two dates (your column date and the variable port date) and populate the status.
If you just want to verify the result of the expression trunc(sysdate,'d') you can fire the following query in the oracle db:
"select trunc(sysdate,'d') from dual"
result returned would be the latest Sunday date.