I have imported an Excel file to Power BI service from my OneDrive for Business.
The file contains a simple Excel table and one of the fields is a date.
Now, in Power BI service, I get that field displayed as a whole number which isn't very useful to read in a report.
How do I change the field to display as date?
Thanks!
We can use FORMAT() method to format date value, Use below mentioned formula
Syntax: Column = FORMAT(Table[column],"MM/DD/YYYY")
Column = FORMAT(DailyActiveUsers[startDate],"MM/DD/YYYY")
Before my data:
After my data:
This usually works by default for true Excel dates. Anyway, just open the Edit Queries window and navigate to your table. In the column header for your Date, change the Data type to Date. Close & Apply to see the result in your report.
Related
I have a dashboard to convert - source needs to change from custom, local Excel file to a dataset and SQL Server table via DirectQuery. Excel file was created by exporting data from said dataset, which have been worked over.
Now, the problem is that I don't have date column available, all I can do is convert date_key (int) column into date, and I need a hierarchy to drill down in visuals from years to days.
This is what I have in table based off Excel:
This is what I have in table that I need to use:
Definition of Date:
Date = FORMAT(Date(Left('A'[date_key],4),Right(left('A'[date_key],6),2),right('A'[date_key],2)), "dd/mmmm/yyyy", "en-GB" )
I can create additional columns to add to the hierarchy:
...and it sort of works, but visual is awful to read when drilling down:
instead of
and of course converting month to name (January instead of 1) reorders them alpabetically...
Is there something to be done here, please?
I have just created a table in Power BI Report view (After creating my data set). I now need to create either a drop-down selection of 2 options or a text input into the table row.
Example:
Column 1 = Project | Column 2 = Project Name | Column 3 = Required Input Box
Project A | Best Project | Drop-down Selection / Free text input
Is there any way for me to accomplish this in Power BI?
Thank you all in advance.
This is not how PowerBI and reporting works.
You're misunderstanding Frontend with Reporting.
Once data is imported in Direct Query / Import Mode (if you're in Desktop PowerBI) you can only transform it by using DAX or M queries, but appending data to report dynamically is not a feature of PowerBI.
But, you can upload an excel on Sharepoint and then set your dashboard data source to the sharepoint link, this could be your hack to achieve what you're trying to do.
There is no actual way to edit data in power bi, you may use power automate to append your data source.
I have a column with data type any as it contains different values (numeric, text, decimal, etc.)
In the power bi desktop, a value in a row is shown as 5.1 which is fine according to the data source.
But when I open it in the Power Query Editor and select this value in the table, it shows 5.0999999999999996 in the window below the table. And this same value is then reflected in the power bi report visuals and tables.
I reentered the same value in the data source and removed formatting but it still shows this long number in the report visuals instead of 5.1.
Any idea what is wrong here?
Thanks in advance
I am working on a report and updated the power bi dataset with the most recent data. However, for some reason a column is recognizing the data as a string instead of numeric. I checked the excel file it is updated from, but in the excel file the column is considered numeric. Any idea how to fix this, as i cant use the data as a string. In addition, it would be beneficial if there was a way to change the dataset to just using the excel file, instead of having to use power bi datasets, is there any way to do that as well, as when i try to change datasets in only lets me view power bi datasets.
Thank you!
In Power Query change the datatype to numeric.
I'd like to slice across visuals based on dates in MS Power BI (i.e., one filter for say month will slice all visuals for that time period.
I created a date table from http://www.agilebi.com.au/power-bi-date-dimension/ to link to the date columns in each table.
I connected xlsx workbook.
Image of columns in Power BI
I added tried to edit the relationship so connect the 2 date columns. However, when I insert the filter using the date_table as values and try to use it, the visuals disappear.
Visuals are Gone
However, when I create the slicer and slice across multiple visuals, they go blank.
**I tried changing the type to "Both" but it didn't fix the problem.
The script at AgileBI.com.au creates a date table with a 'Date' field that has a data type of text. You can (surprisingly) do a relationship between 2 fields of different data types and not get an error. However, a join between a text field that contains dates, and a regular date field will mean that rows that look like they should match up do not.
You can confirm this is happening by picking a value in the 2 tables that you think should match up and seeing if they are identical. In my case, I had Tuesday, November 01, 2016 in my imported table, and 11/1/2016 in the other table. While they both represent the same date (in the US), they clearly look different. A good place to see this is in the Edit Relationship screen (and it definitely would have been helpful to include a screenshot of that in your original post).
Anyway, if the dates in your table don't match up to the corresponding (text) dates in the Date table, then when you filter to "2016" on your slicer, the visuals will all go blank.
I would recommend:
Click Edit Queries
On the left hand side, select the table of dates (called Invoked Function by the script)
Click on the header for the Date column (it will likely already be selected)
Select Transform on the ribbon
Change the Data Type from Any to Date
Click Home > Close & Apply
Hope this helps.