Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
stusmif
Frequent Visitor

Combine files in a report, but now cannot chnage the data type from whole number in query editor

I have created a Power Bi report
It combines multiple excel files from a SharePoint site
The report is published and everything works fine except...
One column is supposed to be data type %,
however in the sample data only values 1, 2, 0 were present
Power bi set the data type as whole number
And thus, everything in the column rounds to nearest whole number
I have tried to change the data type in the query editor but nothing seems to affect the report, it always rounds to nearest whole number.
Please help…

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

@stusmif 

I'm hazarding a guess here, but the data type has probably been set automatically as an integer. Check in Power Query, under the Applied Steps, look for "Changed type":

Changed type.JPG

 

You can either delete the step and set the data types for each column manually or change the type in the code itself to "number"

Changed type 1.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

5 REPLIES 5
PaulDBrown
Community Champion
Community Champion

@stusmif 

I'm hazarding a guess here, but the data type has probably been set automatically as an integer. Check in Power Query, under the Applied Steps, look for "Changed type":

Changed type.JPG

 

You can either delete the step and set the data types for each column manually or change the type in the code itself to "number"

Changed type 1.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






thank you 🙂 

Thank you!... it worked kind of... I have 5 'chnage Type' steps, most of them were intentional. I have deleted them all as a test and the column is displaying correctly. However I really only want to delet the right one save a lot of work, applying query chnages takes a long time so testing iteratively not easy either. is there a way to see what each chnaged type is doing? 

I cant seem to see the formula view of the 'chnaged type' step in your screenshot

@stusmif 

 

The rogue transformation in your case is most probably in the very first step for "Changed Type" (the first in the list the applied steps).

You can enable the formual bar by going to "View" in the ribbon and checking the "formula bar" checkbox:

formula bar.JPG

 

Alternatively you can find the rogue transformation by looking at the whole code under "Home" and "Advanced Editor".

Advanced editor.JPG

 

Look for the first "Changed Type" step, find the column (by name) and change the code of
{"Sales", Int64.Type} to {"Sales", type number} (where "Sales" is the column you need correcting (so whatever the column is labeled in your case). Be careful since M code  is case sensitive.





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






amitchandak
Super User
Super User

@stusmif , Please also check data type in Data model view or column tools.  It needs to be decimal with a few decimal place. If needed % is selected

 

Data Format New Rib.png

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.