Query small decimals into PowerBI - powerbi

Is there any way to shut off auto rounding in Power BI. I'm querying data from SQL Server and the small values for example (.00058) does not even show a value in PowerBI but I know it's there when I export the data from SQL into a CSV

There is no automatic way but you can easily change it. Select your column (or measure) and on the ribbon, select column tools. Ensure decimal number is selected and change the number of decimal places visible.

Related

Why is Decimal to Whole number is preventing Power Query from showing native query?

I have a large dataset with 50M+ rows. Database is on sql server 2019.
In Power Query, all but the last step shows the native query. The last step is converting the value (for some reason Power query picks up the number as decimal) to whole number. When I right-click on this step it shows the native query option disabled.
Why is Decimal to Whole number is preventing Power Query from showing native query? What is the way to achieve native query in this situation?
My intention is to configure incremental load on this table.
Assuming your data source is SQL (?) you could
SELECT CAST(myObscureNumber AS int)
Changing datatypes frequently breaks query folding and is mentioned in the docs. Here is a good read: https://blog.crossjoin.co.uk/2021/06/29/data-type-conversions-for-sql-server-sources-and-query-folding-in-power-query/
Connectors are regularly updated to include more native DB features and enable better folding.
EDIT - Don't do this - see David's comment for why this is not efficient
If PQ folds the conversion to, say, select cast(dt as date) d, ...
from t and then the user filters on the projected column d, will
result in SQL query like select ... where cast(dt as date) >
'2022-01-01', which can't use indexes or partitions, and will have to
convert the dt column for each row to compare it with the filter
value. – David Browne - Microsoft 1 hour ago
According to this, you could try decimal to text and then extract the text before the decimal point to avoid breaking the query fold.
https://en.brunner.bi/post/changing-data-types-that-do-not-break-query-folding-in-power-query-power-bi-1

Unusual decimal value in the report visuals and tables

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 want to convert decimal digits to percentage in a column that has multiple data types

I want to convert decimal digits to percentage in a column that has multiple data types in Power BI.
How do I achieve this using query/measure in Power BI?
Input data: Data type of the column: Any
Expected output data
I have already tried using manually, but I need to know how to get the output dynamically using query/measure in power BI
Is this a measure, column or calculated column? if measure or calculated column you can do this in the "format" section in "column tools" section.
If it is a measure you will see it in the "measure tools" in the format section as well.
In both cases there should be a drop down menu that allows you to format the output.
You can use this convention to make the measure:
MeasureName:=IFERROR(sum(TableName[ColumnName]),blank())

Power BI Desktop doesn't honor percentage column type

I've imported data (approximately 200 columns) into Power BI desktop (latest version as of 2017-08-02) and have explicitly told the app to treat a number of columns as being percentages. Within the query editor, I can verify that my values are treated as such:
When I put my data into a table, they show up as normal floats, not percentages. When I click on the exact same column as in the above picture and view it in the Modeling tab, Power BI shows it as being "General" format:
While I can go through and change the formatting here to have them all be percentages, I have already done so in the query editor! Is there a way to make PBI recognize my already specified format?
Short answer: No.
Explanation:
In the query editor, you didn't actually specify any format. What you specified is the data type, so that the source data can be read correctly. Say you have a column with data like 001, you can specify it as text type so you can retain the leading zero.
However, the actual formatting (i.e. data presentation) is done in your second step, because even if it's a (decimal) number, you can still format it as a percentage, with different decimal places, etc. (vice versa)

Is there a decimal number slicer in in PowerBI?

I'm showing a collection of points on a map in PowerBI and I would like to filter them to show, for example, only points contained between latitude x and y.
I can do that using the filter panel by setting rules on my latitude so it shows only points with latitude greater than x and less than y. However, I'd like to use a visual component to do that. The "Advanced Time Slicer" from the Visuals Gallery seems to do something really similar to what I'd like to achieve however it works with date/time values only.
I think what I would need is a simple and generic slicer that can select a range within a set of decimal values. Is there any component in PowerBI to achieve this ?
I would use the Filter pane. You could add your latitude field to the Visual Level Filters well (on the Visualizations pane, under Filters). Then a user viewing the report can open the Filters pane and specify a range of numeric values, e.g.
Show items when the value:
is greater than
10
and
is less than
30
This answer is for users who are still having this problem. This can be solved from the latest update of Power BI - Here is the corresponding Link.
Step 1. Duplicate the latitude and longitude column using query editor & give them the datatype of decimal number using query editor again.
Step 2. Put these decimal number latitude and longitudes columns that you just created inside the
numerical slicer. Link to the official document that talks about Numerical Slicer in PowerBI.
This would save us from creating measures to identify the between values of lat and long.