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.
Hola
Quiero hacer un filtro personalizado si una columna tiene ciertos valores: Si columna = "A" o columna = "B" o columna = "C" entonces "filtro" de lo contrario "no filtro".
¿Hay un operador IN, si la columna IN {"A","B","C"} en M Language/Power Query?
Muchas gracias
Solved! Go to Solution.
Aquí hay una forma de hacerlo en el editor de consultas. Para ver cómo funciona, simplemente cree una consulta en blanco, abra el Editor avanzado y reemplace el texto allí con el código M a continuación. Puede usar List.Contains( ) para hacerlo.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YlWcgKTzmDSRSk2FgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Letter = _t]),
#"Added Custom" = Table.AddColumn(Source, "Custom", each if List.Contains({"A", "B"}, [Letter]) then "Y" else "N")
in
#"Added Custom"
Palmadita
Aquí hay una forma de hacerlo en el editor de consultas. Para ver cómo funciona, simplemente cree una consulta en blanco, abra el Editor avanzado y reemplace el texto allí con el código M a continuación. Puede usar List.Contains( ) para hacerlo.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YlWcgKTzmDSRSk2FgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Letter = _t]),
#"Added Custom" = Table.AddColumn(Source, "Custom", each if List.Contains({"A", "B"}, [Letter]) then "Y" else "N")
in
#"Added Custom"
Palmadita
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 |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |