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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
vivapayne
New Contributor

Using Columns within Slicer

Hi all

I want to use a slicer to impact the data in a visual, but I can't figure it out! 

 

As the data stands at the moment I have three columns:

Team1Team2Total
01010
51520
10515
15015

What I'd like to do is show the total in the chart as default, but then use the slicer to display the relevant team when selected. Because of the size of the data table, I can't realistically have two or three lines of data per record. I've tried using in hierarchy, but I can't get that to work.

 

Do any of you have any ideas please?

 

Thanks in advance.

 

1 REPLY 1
lbendlin
Esteemed Contributor III

Unpivot your data.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlDSUTI0UIrViVYyBTFNwUxDkDCUCRIGKogFAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Team1 = _t, Team2 = _t]),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {}, "Attribute", "Value"),
    #"Changed Type" = Table.TransformColumnTypes(#"Unpivoted Columns",{{"Value", Int64.Type}})
in
    #"Changed Type"

How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done".

 

Helpful resources

Announcements
Users online (25)