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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

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 Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

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.