Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi All
I am trying to filter a table to get records that have had two specific status's ( 2 and 9), sample data is below.
So the ID's that match the criteria are 1, 2 , and 4.
Thanks in advance.
ID | Status | Dateupdated |
1 | 2 | 01/03/2019 |
2 | 2 | 06/03/2019 |
3 | 1 | 12/12/2018 |
4 | 2 | 27/07/2019 |
5 | 4 | 30/05/2019 |
1 | 9 | 15/05/2019 |
2 | 9 | 21/06/2019 |
3 | 4 | 05/06/2019 |
4 | 9 | 14/09/2019 |
5 | 8 | 11/02/2019 |
1 | 10 | 02/11/2019 |
4 | 9 | 03/10/2019 |
5 | 10 | 19/11/2019 |
Solved! Go to Solution.
What is your preferred solution, Power Query or DAX?
In Power Query (I suspect this is not what you meant):
paste this into the advanced editor of a blank query.
let
Source = Table.FromRows(
Json.Document(
Binary.Decompress(
Binary.FromText(
"ZY/BDcAgDAN34V0pToAWZkHsv0Yd1IpGleBzMecwRtJ0JOOFCrIYtKd5jIUWPgPORP5CTXiI28LlSdsluHa6EvkoQ1A3dkF3SQ3YHmzc5IyVLmH0i8srKYIeK5tjSixWKtzCxfVv4R8V0bLi2nd83g==",
BinaryEncoding.Base64
),
Compression.Deflate
)
),
let
_t = ((type nullable text) meta [Serialized.Text = true])
in
type table [ID = _t, Status = _t, Dateupdated = _t]
),
#"Filtered Rows" = Table.SelectRows(Source, each ([Status] = "2" or [Status] = "9"))
in
#"Filtered Rows"
In DAX you could create this filter as a measure and use it to filter the visual.
filter =
SWITCH(
TRUE(),
SELECTEDVALUE(Table[Status]) IN {2, 9}, 1
)
Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). |
If you found this post helpful, please give Kudos. It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen. If you find my signature vaguely amusing, please give Kudos. | Proud to be a Super User! |
Thank you!
The DAX solution was what i was looking for.
Have a great day
What is your preferred solution, Power Query or DAX?
In Power Query (I suspect this is not what you meant):
paste this into the advanced editor of a blank query.
let
Source = Table.FromRows(
Json.Document(
Binary.Decompress(
Binary.FromText(
"ZY/BDcAgDAN34V0pToAWZkHsv0Yd1IpGleBzMecwRtJ0JOOFCrIYtKd5jIUWPgPORP5CTXiI28LlSdsluHa6EvkoQ1A3dkF3SQ3YHmzc5IyVLmH0i8srKYIeK5tjSixWKtzCxfVv4R8V0bLi2nd83g==",
BinaryEncoding.Base64
),
Compression.Deflate
)
),
let
_t = ((type nullable text) meta [Serialized.Text = true])
in
type table [ID = _t, Status = _t, Dateupdated = _t]
),
#"Filtered Rows" = Table.SelectRows(Source, each ([Status] = "2" or [Status] = "9"))
in
#"Filtered Rows"
In DAX you could create this filter as a measure and use it to filter the visual.
filter =
SWITCH(
TRUE(),
SELECTEDVALUE(Table[Status]) IN {2, 9}, 1
)
Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). |
If you found this post helpful, please give Kudos. It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen. If you find my signature vaguely amusing, please give Kudos. | Proud to be a Super User! |
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
User | Count |
---|---|
90 | |
89 | |
79 | |
69 | |
68 |
User | Count |
---|---|
222 | |
128 | |
117 | |
82 | |
77 |