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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

editing queries

Hello,

 

I have a query that I need to edit, but it does not know how to do this, the query you want to edit is this:

 

= Fonte{[Item="FTEGF_EmpenhoPago",Schema="dbo",Catalog="TeresinaDw"]}[Data]

 

I want to apply a filter to it.

 

is it possible to do that?

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

On Home tab, click Edit Queries. This will open a new window with your queries listed down the side, pick the query you want and insert or add steps.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Okay, but I have doubts as syntax to be used, I want to add a filter that query

So, in the query editor, select the query. Find the column that you want to filter on. Click the drop-down arrow on that column and uncheck the particular things that you want to filter out. Here is an example query with the last step being a filter operation. This is one type of filter operation but you can also use the interface to do things like remove blank rows, remove duplicates, remove errors, only keep the top or bottom rows, etc.

 

let
    Source = Csv.Document(File.Contents("C:\temp\azureml\SF_Incident_Data_Prepped.csv"),[Delimiter=",", Columns=15, Encoding=1252, QuoteStyle=QuoteStyle.None]),
    #"Promoted Headers" = Table.PromoteHeaders(Source),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"IncidntNum", Int64.Type}, {"Category", type text}, {"DayOfWeek", type text}, {"Date", type date}, {"Time", type time}, {"PdDistrict", type text}, {"Resolution", type text}, {"Address", type text}, {"X", type number}, {"Y", type number}, {"Location", type text}, {"Resolved", Int64.Type}, {"Month", Int64.Type}, {"Year", Int64.Type}, {"Hour", Int64.Type}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([DayOfWeek] <> "Monday"))
in
    #"Filtered Rows"


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks, but @Greg_Deckler is running some error with my script, what am I doing wrong?

 

let

 

Source = Odbc.DataSource ("dsn = DwProd"), FTEGF_Iniciativa_dbo_TeresinaDw Source = {[Item = "FTEGF_Iniciativa" Schema = "dbo" Catalog = "TeresinaDw"]} [Date] Filtered Rows FTEGF_Iniciativa_dbo_TeresinaDw.Exercicio_Movimento_ID => Exercicio_Empenho_ID


in

 

FTEGF_Iniciativa_dbo_TeresinaDw Filtered Rows

Filtered Rows

Not sure if that is a copy and paste error, you might try the little page icon with the </> to paste code but that does not look like valid "M" script. The Source line seems OK, but after that, each line should end with a "," except the last and begin with a "#" and then your "in" clause should only have a single line (in general) and it should refer to one of the # sign line names.

 

How did you generate this M code?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors