The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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?
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.
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"
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?