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.
Greerings -
I have a column that has both 'Table' and 'text' values.
What I'd like to do is;
If value type == table then, extract values to new column (myNewCustomColumn) as CSV.
else copy existing value to new column (myNewCustomColumn).
Can someone please help w/ this type of logic/formula?
Attached mockup of data for clarity.
Thanks!!!!
Solved! Go to Solution.
Hi @ihayes916,
You can use below query to get expand values:
let Source = #table( type table [#"Component"=any], { {"abc"}, {"Cda"}, {"AAA"}, {#table({"Element"}, {{"esc"},{"Test"}})}, {#table({"Element"}, {{"EAd"},{"BAA"}})} }), #"Added Custom" = Table.AddColumn(Source, "Expand", each if Value.Is([Component],type table) then Text.Combine([Component][Element],",") else [Component]) in #"Added Custom"
Regards,
Xiaoxin Sheng
Hi @ihayes916,
Can you please share some sample data or pbix file for test?
Regards,
Xiaoxin Sheng
Hello @v-shex-msft!
Thanks for the reply. Unfortunatly, I can't share the data and I've not found a way to recreate a small sample data set.
I've attached a more refined version (screen shot) of my request.
Column1 (Component) is my source data.
Column2 (ExtractedValues) is the custom column that I am hoping to be able to create. I've mocked up the result I'd like to see for each of the 3 scenarios.
Again, thanks for any help you might be able to provide!
Hi @ihayes916,
You can use below query to get expand values:
let Source = #table( type table [#"Component"=any], { {"abc"}, {"Cda"}, {"AAA"}, {#table({"Element"}, {{"esc"},{"Test"}})}, {#table({"Element"}, {{"EAd"},{"BAA"}})} }), #"Added Custom" = Table.AddColumn(Source, "Expand", each if Value.Is([Component],type table) then Text.Combine([Component][Element],",") else [Component]) in #"Added Custom"
Regards,
Xiaoxin Sheng
Thank you so much!!!!! I came to a similar solution (albeit w/ one extra step) but I like yours better!!!
Truly appreciate it!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
126 | |
106 | |
105 | |
86 | |
72 |