I have data column name "Loss Date" I want to create new column "Policy Date" based on this column and the condition is if Month<4 then display last year date otherwise not. actually, I want to create Policy Date column and I want to display in this bar chart which is given below,
can anybody helps me regarding this in PowerBI?
In Power Query Editor, add a custom column with this below code-
=if Date.Month([loss date]) < 5 then "Apr-"& Text.From(Date.Year([loss date]) - 1) &" to Mar-"& Text.From(Date.Year([loss date])) else "Apr-"& Text.From(Date.Year([loss date])) &" to Mar-"& Text.From(Date.Year([loss date]) +1)
Here is the output-
Now you can use that new column to your chart for generating Bars.
Related
I have a "Report Deadline" column and "Date Report Issued" column on my table, and both are date-only columns with rows that can be blank. My goal is to add an additional column to the table that says "TRUE" only if the Report Deadline date has already passed AND there is not a date in the Date Report Issued column, it should show "FALSE" for any other scenario.
The formula I have created is shown below
=AND([#[Report Deadline]]<TODAY(),[#[Date Report Issued]]="",[#[Report Deadline]]>0)
But this formula seems to just display FALSE for all of the values, how can I correct it.
This worked for me (change the test for empty cell to isBlank()):
=AND([#[Report Deadline]]<TODAY(),ISBLANK([#[Date Report Issued]]),[#[Report Deadline]]>0)
Try this function. =if(and([column 1 reference]<Today(),not(isblank([column reference 2]))),true
I am new to Power Query.
I have a database, containing all text fields, to populate onto an excel spreadsheet as a requirement for business purposes. I am not allowed to add or delete tables in the spreadsheet. The problem I'm having is with the End Date column.
The End Date column can either have a date format or "TBD" as text if there is a start date but no end date.
Essentially I need power query to format the incoming in the End Date column as a date, unless the row contains "TBD". In that case I need the row to remain as "TBD". However as you can see from the picture above, it fails to populate correctly.
This is the formula I've been trying to get working but I haven't had any luck. Is there a way to accomplish this task?
= Table.TransformColumns(
_qryPerstat,{{"END DT",
each if qryPerstat[END DT] = "TBD" then "TBD" else Date.From(DateTimeZone.From()), type date}})
I'm sure someone will ask "Who cares?" but having been (badly?) influenced by a former colleague early in my career ("Never ever repeat the same calculation, just store the result and reuse it!") I'm updating an Excel spreadsheet which currently displays the weekday for days in the current year, using
=IF(AU2=0,DATE(YEAR(TODAY()),MONTH(A2),DAY(A2)),"")
where column A, rows 2-367 ("n" in the above formula), contain dates from 2016-01-01 to 2016-12-31, displayed as "1 January" to "31 December"
Column AW contains the above formula to display the weekdays, in (obviously) the current year where the value in column AU is zero.
To make the results a bit more dynamic, i.e. to display the weekday of the next year (potentially conditionally formatted in another colour) if year(today()) + the month and day of column A are before today, I can change the formula in column AW to
=IF(AU2=0,IF(DATE(YEAR(TODAY()),MONTH(A2),DAY(A2))<TODAY(),DATE(YEAR(TODAY())+1,MONTH(A2),DAY(A2)),DATE(YEAR(TODAY()),MONTH(A2),DAY(A2))),"")
(and to the same to the formulas in columns AX/AY/AZ, which display the weekdays if
AX: AU <> 0 & AU <= 250
AY: AU <> 0 & 250 < AU <= 500
AZ: UU <> 0 & 500 < AU <= 1000
but that results in the same long-winded calculation of the date being repeated 1,464 times, and this particular sheet is already quite slow, as it contains data for 39 years.
So, is there an (easy) way to simplify this kind of processing, like adding a (hidden) column containing the calculated date, or a thisyear/nextyear indicator to speed things up? Or do I just accept the "Who cares!" attitude?
In the worksheet, select the formula you want to make it reusable, and then click the New Autotext button. 3. In the New AutoText dialog box, type a name for this auto text entry in Name box, select Formulas in Group drop-down list, and then click the Add button.
see https://www.extendoffice.com/documents/excel/2634-excel-reuse-formula.html#:~:text=In%20the%20worksheet%2C%20select%20the,then%20click%20the%20Add%20button. for more information
I'm using Excel and PowerQuery to show different tables of data, each table showing the data for that month. I'm using the built-in date operators 'This Month' and 'Next Month' but there's not one for 2 months time.
I can select an arbitrary month, but that doesn't work because I need the data in the tables to automatically refresh when we move to the next month.
I can see in the advanced editor that the formula for next month is = Table.SelectRows(#"Removed Columns", each Date.IsInNextMonth([#"Forecast Date (DD/MM/YYYY)"])) but I can't work out how to adapt this to show 2 months time...
Any help/guidance much appreciated!
You could use the greater than...less than method and construct your dates based on Today's date:
#"Filtered Rows" = Table.SelectRows(#"Changed Type",
each [dates] >= #date(Date.Year(DateTime.LocalNow()),Date.Month(DateTime.LocalNow())+1,1)
and [dates] < #date(Date.Year(DateTime.LocalNow()),Date.Month(DateTime.LocalNow())+2,1))
where [dates] is your column containing the dates you want to filter, and Changed Type is the previous line in your code.
I have a problem with the "Year" and "Weeknum" functions in excel 2013.
I tried the formula below using the functions:
=YEAR(RC[1])&"_WW_"&IF(Weeknum(RC[1])<10,"0"&Weeknum(RC[1]),WeekNum(RC[1]))
On some dates, I get back "#VALUE!" and
And the correct field for other dates...
for example:
for the date "11/30/2013 20:15:00", I'm getting "#VALUE"
for the date "12/07/2013 20:15:00", I'm getting "2013_WW_28"
when evaluating formula, both "Year" and "weeknum" return "#VALUE!".
and On both of the examples, the date field is set as "General" (trying playing with it and change it to "long date" or "short date"' and it didn't work...)
If the format is general in this context that means your "dates" are text values
The only dates that are deemed valid are those where day <= 12......and those are being interpreted the wrong way round hence wrong WEEKNUM.
You can try changing to valid dates with "text to columns" but you may lose the times, is that a problem?
Select date column then.....
Use Data > Text to Columns > "Fixed width" > Next > at step 2 insert a line between times and dates > Next > at step 3, with date column selected, under "column data format" choose "date" and the source format (MDY) > OK
This should convert to valid date format for your region and formula should work as expected