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.
Hello,
I think I need your help on a filtering I would like to do.
I have a table TP, simplified, as below. It contains a column P with some references and a column L containing a list of tags. Why I would like to do is to create a dynamic filter table in which I could just click on one of the tags that would filter the list of references in table TP
My first step : to be able to create a table of tags that I could use as filter
TP is the initial table
P | L |
P1 | AA,BB |
P2 | BB |
P3 |
After creating a 1st table, named TPS, split of table TP by column L with option by Rows I get a table as below
P | L |
P1 | AA |
P1 | BB |
P2 | BB |
P3 |
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCjBU0lFydNRxclKK1QFyjYBcGNsYyFaKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [P = _t, L = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"P", type text}, {"L", type text}}),
#"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Changed Type", {{"L", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "L"),
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"L", type text}})
in
#"Changed Type1"
Then, from TPS, I build a 3rd table of possible tags, named TF just by removing other columns as explained in post (LINK)
F |
AA |
BB |
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCjBU0lFydNRxclKK1QFyjYBcGNsYyFaKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [P = _t, L = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"P", type text}, {"L", type text}}),
#"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Changed Type", {{"L", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "L"),
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"L", type text}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type1",{"P"})
in
#"Removed Columns"
Then, I create a model with relationships between TP.P and TPS.P (n to 1) using L column as Key and a second relationship between TPS.L and TF.F (n to 1) using L/F as a key
At this point, if I create a display with the three tables in same page, when I click on a row of table TF this is filtering correctly in table TPS (where I have the split) but nothing happens for the initial table TP. Somethink like there is no transitivity...
--> This is second problem I am trying to solve... with your help
Tables with filtering
If I select in table TF row containing AA, selecting correctly applies on table TPS but nothing happens on table TP...
Thanks for your help!
Solved! Go to Solution.
Hi
I found a solution on
- remove all relationships
- create a measure attached to TP
Measure = SEARCH(
SELECTEDVALUE(TF[L]),
SELECTEDVALUE(TP[L]),
,-1
)
- Add a slicer with Measure greater than or equal to 1
Get rid of table TP from the finished model - it's redundant.
If you want a table visual that represents a filtered table TP then build it from TPS (probably using CONCATENATEX in a measure to build the string)
Hi
I found a solution on
- remove all relationships
- create a measure attached to TP
Measure = SEARCH(
SELECTEDVALUE(TF[L]),
SELECTEDVALUE(TP[L]),
,-1
)
- Add a slicer with Measure greater than or equal to 1
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 |
---|---|
109 | |
106 | |
87 | |
75 | |
66 |
User | Count |
---|---|
125 | |
114 | |
98 | |
81 | |
73 |