Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
I have a true/false parameter within power query.
Now within my table I have a column which is the name of each products.
But when I have the parameter set as TRUE, I require the column to then show as:
Is there a way to achieve this?
Thanks
Solved! Go to Solution.
Hi @DW868990 ,
In power query, click "Advanced Editor" and copy and paste the following code.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WciwoyElVitWJVgpITUwsgrGAjFgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type),
#"Replaced Value" = Table.ReplaceValue(#"Added Index",each [Column1], each if Parameter1=true then Text.Combine({"Prod ",Text.From([Index], "en-US")}, "") else [Column1],Replacer.ReplaceValue,{"Column1"})
in
#"Replaced Value"
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @DW868990 ,
In power query, click "Advanced Editor" and copy and paste the following code.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WciwoyElVitWJVgpITUwsgrGAjFgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type),
#"Replaced Value" = Table.ReplaceValue(#"Added Index",each [Column1], each if Parameter1=true then Text.Combine({"Prod ",Text.From([Index], "en-US")}, "") else [Column1],Replacer.ReplaceValue,{"Column1"})
in
#"Replaced Value"
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
HEllo @DW868990 ,
Try acheiving this using field parameters https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
Follow me on Linkedin
Vote for my Community Mobile App Idea 💡
Proud to be a Super User! | |
ah sorry, I wasnt clear, the parameter is a parameter within the power query editor, not a field parameter.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
216 | |
89 | |
82 | |
66 | |
57 |