The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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:
Team1 | Team2 | Total |
0 | 10 | 10 |
5 | 15 | 20 |
10 | 5 | 15 |
15 | 0 | 15 |
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.
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".