Date Format in Power BI Hierarchical Slicer - date

I have a Power BI file that connects to a data model via SSAS. The data model origin is a SQL Server view with some computed columns added in via SSAS.
One of the visualisations is a Hierarchical Slicer that shows dates. The field is not one of the computed SSAS columns. It displays in DD/MM/YYYY format but when I place the file on a Power BI Report Server the format is Americanised to MM/DD/YYYY. I want it to be DD/MM/YYYY.
The same field is used to populate a table visualisation but in there it remains DD/MM/YYYY. Just the slicer is affected.
This blog https://community.powerbi.com/t5/Desktop/date-format-in-slicer/td-p/215627 seemed to have the answer I needed but these settings were already applied and still the slicer shows MM/DD/YYYY.
Its not a problem when I open the pbix file locally; there, the slicer shows the dates as DD/MM/YYYY, its just when its on the server. The same problem persists in Test and Production and I have checked those settings and they are as the blog indicates. Other blogs identify this with the slicers but do not present a real solution as its not seen as a problem in those topics.
I've only spent a month working with Power BI so have no real experience to draw upon. I know that SQL Server defaults to American English when connecting to a database and I have changed that to British English but still the same problem. How do I get the slicer showing as DD/MM/YYYY as in my local copy?

Select the Date column and then go to the Modeling tab and change Format to whatever Date format you want.
OR
You can create a calculated column using the FORMAT method in DAX to convert date format as you want.
See reference here: https://msdn.microsoft.com/en-us/library/ee634398.aspx

Power BI is missing the formatting in their recent releases. However, the below solution works for me:
Create a Calculated Column ref. the original Date column and apply "Short Date" format for Date, example:
Transaction Date =
FORMAT(DATE(
YEAR([Transaction_Date]),
MONTH([Transaction_Date]),
DAY([Transaction_Date])
), "Short Date")

Related

How to correctly format dates in Power BI

I am connecting to a stored procedure in SQLServer, from the data source the column AnioMes arrives as follows:
Once loaded in PowerBI it has the same format as follows:
I would like to give the correct format separating the year and the month in new columns, someone can give me an orientation on how to do it.
If this is an import model, just convert the number to a date in PowerQuery. For beginners in Power Query Add Column From Examples is your friend.
If it's DirectQuery or Import, you should have a calendar table (aka a Date Dimension) in SQL Server that you can join this column to, and bring that into your model.

Power BI Week Visual Filtering

Power BI novice here. I have multiple reports which require date filtering by week. I can sometimes get the data to display with my Week column using dates from a column in the same table.
I thought building a Week column based on the date column would result in an easy to use visual. The week column is calculated by:
WeekYear = IF(
FORMAT(WEEKNUM(START.[Date],1)-1,"00"="00",
"Wk53-" & YEAR(START.[Date])-1,
"Wk" & FORMAT(WEEKNUM(START.[Date],1)-1,"00") & "-" & YEAR(START.[Date]))
This results in an x-axis displaying weeks in this format: Wk52-2019. If the underlying data of column STARTis in the proper datetime format, what could be the issue?
I noticed data on the visual which is not filtered for a date range display without issue. Trying to filter with DATESINPERIOD or other DAX date filters caused calculated measures to not display or break the model. I know a lot of references state having a separate calendar table is critical and I suppose I don't fully understand. Thanks in advance.
If you are trying to create the week in date format, then you can use the following calculation:
Week = Table[Start] - WEEKDAY(Table[Start],2)+1
This returns the Monday date of the week, if you want other days you can adjust the calculation accordingly.
If this is not what you are looking for, then you might have to clarify your requirements a bit more.

Qlik Sense: Change date field format from Google Analytics API

I've pulled in data in Qlik Sense (cloud) from the Google Analytics connector. I'm trying to convert the standard date [ga_dateHourMinute] field to a more eligible date format.
The current format is YearMonthDayhHourMinute, for instance: 201810250004, I would like to convert this to the standard date format 2018-10-25 00:04:00. How do I do this? Answers concerning methods in the data load script or master formula's or variables are all welcome.
Click to see screenshot: left = current date format and right = desired date format
This is one approach:
DateAlter:
LOAD * INLINE [
Date
201810250004
];
DateAlter2:
LOAD
Date(Date#([Date], 'YYYYMMDDhhmm') ,'YYYY-MM-DD hh:mm') AS [MyDateField]
Resident
DateAlter;
If you haven't played around with the data manager, it will allow you to edit fields and handle dates in a fairly easy manner:
Qlik Sense Data Manager
I ended up creating a text fields that combined the different digits from the one field into a new order, then pushed the data format into a date/time. Quite a bit of work, but fairly solid.

Why am I getting iso 8601 dates from my Postgres database?

I'm using Seekwell to connect my AWS postgres database to Sheets.
I think I'm converting my dates to standard 'date' (YYYY-MM-DD) format in the code, eg.
date(date_trunc('day', u.created_at::date)) Date_Created
However, when the query is run, my dates are iso 8601, eg.
2018-05-16T00:00:00.000Z
Of course, given that my results are going into Google Sheets, I can always convert those dates there in sheets, but that adds a layer of complexity that is hard to manage.
How can I make sure the dates are formatted correctly before the results land in sheets?
Michael from Seekwell tells me this is:
a bit of bug with how JDBC handles dates in the background. You're on Postgres, right? This should work from within the add-on:
to_char(your_date_column, 'YYYY-MM-DD')
Sheets will recognize that result as a date.
This worked.

Tableau String to Date Time Format Issues

I am pulling in date information via MySQL and the date is in the string format of "MM/dd/YY hh:mm:ss"
Using the built in conversion to date isnt working; so I tried using DATEPARSE and also using DATE and manually parsing it. I have had no luck and I have no idea why I keep getting "null" as the answer or it is putting the month as year, day as month, and year as day.
See screenshots below for the different formulas I have used:
DATEPARSE
Original date format
DATE with manual parsing
This worked for me using your example original data
DATEPARSE('mm/dd/yy hh:mm:ss',[Time] )
I used tableau's documentation of custom date formats to find the right formula for the format.
If this doesn't solve the problem then it is most likely due to a Locale issue. The Dateparse function relies on the locale specified by your computer settings to interpret and then display the strings you want to convert and can affect whether a certain format can be specified. This means that if a certain format is not recognised it will return a null. This will often occur is the windows region and language format is changed to another language other than the original language the workbook was created it.
So check your locale and if required execute the following workaround (documented by tableau here):
Open Windows control panel > region and language > format
Click format dropdown and change to original language of workbook creation
click ok or apply and reopen tableau work book