Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello all,
I need to change the type only on the columns with $ in the header.
I have the following code:
TransformDollars = Table.TransformColumnTypes(
renameColumns,
List.Transform(
List.Select(Table.ColumnNames(renameColumns), each Text.Contains(_, "$")), each {_, Number.Type})
),
Dollars_Columns_Selected = List.Select(Table.ColumnNames(TransformDollars), each Text.Contains(_, "$")),
RoundDollars = Table.TransformColumns (
TransformDollars,
List.Transform (
Dollars_Columns_Selected,
each {_, Number.Round(_, 3), type number}))
in RoundDollars
but I get this error:
Thanks for your help.
Solved! Go to Solution.
RoundDollars = Table.TransformColumns (
TransformDollars,
List.Transform (
Dollars_Columns_Selected,
// each {_, Number.Round(_, 3), type number})) >> this is wrong, must be
each {_, (x) => Number.Round(x, 3), type number}
)
)
Hello,
I don't see any function in your file.
I know this is possible with standard approach from Power Query, but I am trying to built a function...
Thanks.
Hello,
did you mean changes like this:
RoundDollars = Table.TransformColumns (
TransformDollars,
List.Accumulate(
Dollars_Columns_Selected,
TransformDollars,
(a,b)=> Table.TransformColumns(a,{{b, each Number.RoundUp(_,3), Int64.Type}})))
If so, I got the following error:
Hi @Mic1979 ,
Yes, Based on the data you provided, I have used it as sample data on my end and successfully implemented it. Therefore, please refer to the attached pbix file.
I hope this should resolve your issue, if you need any further assistance, feel free to reach out.
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thankyou,
Have a great day ahead.
use the following formula, source is the name of table in the previous step
= List.Accumulate(List.Select(Table.ColumnNames(Source), each Text.Contains(_,"$")),Source,
(a,b)=>Table.TransformColumns(a,{{b, each Number.RoundUp(_,3), Int64.Type}}))
Hello,
here the link:
Function is FROM_EURO_TO_KDOLLARS.
Thanks.
RoundDollars = Table.TransformColumns (
TransformDollars,
List.Transform (
Dollars_Columns_Selected,
// each {_, Number.Round(_, 3), type number})) >> this is wrong, must be
each {_, (x) => Number.Round(x, 3), type number}
)
)
Thanks Alien
sounds like a mixup between column names and column values.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
10 | |
10 | |
8 | |
7 |