day formula in a if statement - if-statement

I am using the formula below to check to see if January first is on Saturday. The calendar I've created will flip years using a macro in place, so January first may not always lay on a Saturday. The reason I need to use DAY is because the cell it is refering to is in a DAY format.
=IF(DAY(H5)=1,"Winter","") Formula
January 1st Days of the week
2018- Monday Calendar
2019- Tuesday
2023- Saturday etc...
So H5 is the place of the first Saturday in January,
if H5 = January 1st it should show "Winter" if not it should return blank. The issue is the formula is getting caught on the DAY(H5)=1. It returns #Value instead of a blank. Is there a work around I can use to show blanks instead?
I have conditional formatting in place so the cell is grayed out (Font colour and Fill). It looks good when it's in the spreadsheet but once it it is printed it will still show #VALUE.
Thanks in advance,

Wrap the formula in a IFERROR():
=IFERROR(IF(DAY(H5)=1,"Winter",""),"")
Or you can test to ensure the H5 has a value:
=IF(H5<>"",IF(DAY(H5)=1,"Winter",""),"")

Related

How to make the relative week filter to include date starting from Sunday?

When using the relative date filter suppose I select last 2 calendar week, assuming today is a Tuesday then it selects Last to last Sunday to Last Saturday.
Where as if I select last 2 week, then it selects Last to last Wednesday to today (Tuesday). How to make the filter select Last to last Sunday to today?
What you are describing can be achieved with a standard date slider. This isn't possible with a relative date filter.

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

Previous Week Measure - Week 52 2019 and Week 1 2020

I currently use the below measure to retrieve a value for the previous week, however as it's now week 1 of a new year, the field is returning "blank" as it cannot find any previous weeks.
How would I adapt my measure to include something along the lines of... if week 1 use the last week of the previous year, if not use the previous week.
VAR CURRENT_WEEK = WEEKNUM(TODAY()) return
CALCULATE(AVERAGE(DATA_TABLE[VALUE]),
FILTER (DATA_TABLE, WEEKNUM(DATA_TABLE[DATE]) = CURRENT_WEEK -1))
Thanks in advance for your help
I would suggest using a start date and calculating the weeknum from that date. For example, if you choose 1 Jan 2018 as start date, then 1-7 Jan 2018 would be week 1 and first week in 2020 would be week 105. This would solve your issue.
The method you are using becomes really hard to handle if your data has multiple years. Weeknum 1 would denote the 1st week of 2020, 2019 and all the other years. This will mess up the calculation. The above method will make sure you have a unique number for a week.

eliminate weekend dates by shifting it on work dates

I have a worksheet in which there is some work that has to be done on any specific date monthly, weekly, quarterly, yearly and daily. I have a formula that auto shows the planned date on which any work has to be done. But there is a need for change in formula that I have only taken all the dates from Monday to Saturday as Sunday is off here.
The problem arises here. please see C13, D13, E13, date of December (12/8/2019) is Sunday. (please see FT13:FW13). so I want that if Sunday falls on any planned date it should roll over to Monday automatically. for example, if 12/8/2019 is sunday this should show up the planned date automatically in cell FV13 (12/9/2019) which is Monday. it means date should be auto roll from Sunday to Monday. however, I have got a formula that can round up the Sunday for monthly planned works. (you can see E12 ,FT12:FW12) but round up of dates is still needed for yearly and quarterly planned works.
https://docs.google.com/spreadsheets/d/1CXjQDjiP_xTnb8DcpsgQKmLyaaV9XX0NdisvcruuOfY/edit#gid=1924994592
you can simply do IF statement to correct the weekend dates acordingly:
=ARRAYFORMULA(IF(A2:A<>"",
IF(TEXT(A2:A, "ddd")="Sat", A2:A+2,
IF(TEXT(A2:A, "ddd")="Sun", A2:A+1, A2:A)), ))

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