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

View all the Fabric Data Days sessions on demand. View schedule

Reply
SBR1D
Helper III
Helper III

Filter table to records which have two status's

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.

 

IDStatusDateupdated
1201/03/2019
2206/03/2019
3112/12/2018
4227/07/2019
5430/05/2019
1915/05/2019
2921/06/2019
3405/06/2019
4914/09/2019
5811/02/2019
11002/11/2019
4903/10/2019
51019/11/2019
1 ACCEPTED SOLUTION
KNP
Super User
Super User

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 ;).
xOIEmaj

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.
image
fabric-SUbadge
Proud to be a Super User!

View solution in original post

2 REPLIES 2
SBR1D
Helper III
Helper III

Thank you!

The DAX solution was what i was looking for.

Have a great day

KNP
Super User
Super User

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 ;).
xOIEmaj

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.
image
fabric-SUbadge
Proud to be a Super User!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors