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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
rmcgrath
Advocate II
Advocate II

Need help with a line of M Code

Hello.  I need a line of M Code that will NOT filter the following [VOIDSTTS] of 0; [VOIDSTTS] of 1 where [VOIDDATE] > AsOfDate.

Right now, the AsOfDate is 9/6/2025.  Here are what the two columns look like and the third column is what result I am after:

[VOIDSTTS][VOIDDATE]KEEP OR FILTER OUT?
01/1/1900KEEP
01/1/1900KEEP
17/7/2025FILTER OUT
110/1/2025KEEP
01/1/1900KEEP
18/4/2024FILTER OUT
01/1/1900KEEP
01/1/1900KEEP
19/7/2025KEEP

 

1 ACCEPTED SOLUTION
MasonMA
Super User
Super User

If [VOIDSTTS] are of Text data type, and [VOIDDATE] are Date, you can do this by adding a step in M, 

 

Table.SelectRows(#"laststep",
                each

               [VOIDSTTS] = "0" or ([VOIDSTTS] = "1" and [VOIDDATE] > #date(2025, 9, 6))
)

 

MasonMA_0-1764894231849.png

 

View solution in original post

2 REPLIES 2
GeraldGEmerick
Super User
Super User

@rmcgrath Try the following:

Table.SelectRows(#"Changed Type", each ([#"[VOIDSTTS]"] = 0 or [#"[VOIDDATE]"] > #date(2025, 9, 6) ))
MasonMA
Super User
Super User

If [VOIDSTTS] are of Text data type, and [VOIDDATE] are Date, you can do this by adding a step in M, 

 

Table.SelectRows(#"laststep",
                each

               [VOIDSTTS] = "0" or ([VOIDSTTS] = "1" and [VOIDDATE] > #date(2025, 9, 6))
)

 

MasonMA_0-1764894231849.png

 

Helpful resources

Announcements
Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.