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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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