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
dpc_development
Helper III
Helper III

Transform (Pivot Column) data based on slicer/filtered values

I have a dataset that I used Transform -> Pivot Column to move a metric from rows to columns, and then I created a Correlation Plot using those columns.

 

However, this is manual and set in stone. Is it possible to choose a subset of the dataset based on user's selection, transform as above, and then put all the resulting columns in the correlation plot, all during runtime (not edit mode)?

3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @dpc_development ,

 

Does matrix work?

 

Capture.PNG

 

BTW, how about using parameters in power query ? M code for your reference.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTI0UIrVgTKNwEwnENMUzHQGMi3hghZwlilcjwlcHdQgFyATYo4rSBDMcoOz3IEsYzDLAyIWCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Column 1" = _t, #"Column 2" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column 1", type text}, {"Column 2", Int64.Type}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each [Column 1] = Parameter1),
    #"Pivoted Column" = Table.Pivot(#"Filtered Rows", List.Distinct(#"Filtered Rows"[#"Column 1"]), "Column 1", "Column 2", List.Sum)
in
    #"Pivoted Column"

2.PNG3.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi @dpc_development ,

 

Does that make sense? If so, kindly mark my answer as the solution to close the case please. Thanks in advance.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

@v-frfei-msft I ended up using a Python Visual to get what I needed.

 

However, for future reference, can the paramter in your example be set by a Slicer? Cause I need my visuals to update based on filter values changing.

 

Although I have many other fields to filter by.

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.