Forum Discussion
Filtering out data in columns using query editor
Hi EricMEwald
You could write this function in the Advanced editor
Table.SelectRows(table as table, condition as function)
It returns a table containing only the rows that match a condition.
In your scenario, code is like
Let
Source=***,
last step=***,
selectrows=Table.SelectRows(last step, each[revenue]>0)
in
selectrows
Best Regards
Maggie
- EricMEwald7 years agoRegular Visitor
Maggie,
Thank you for the response! Im very new to M, and my knowledge is limited. I have been working in advanced editor, and added some code to modify the date, Is it possilbe you send a snippet of code similar to code i recived for the date modification (below)?
#"Merged Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Added Items", {{"Date Granularity.Level 2: Month", type text}, {"Date Granularity.Level 3: Day", type text}, {"Date Granularity.Level 1: Year", type text}}, "en-US"),{"Date Granularity.Level 2: Month", "Date Granularity.Level 3: Day", "Date Granularity.Level 1: Year"},Combiner.CombineTextByDelimiter("/", QuoteStyle.None),"Date"),#"Changed Type" = Table.TransformColumnTypes(#"Merged Columns",{{"Date", type date}})
- v-juanli-msft7 years agoCommunity Support
Hi EricMEwald
Is this code related to your original question?
How would you like to modify the date in the code below?
I'm not clear what purpose you write this code and let me edit.
Please let me know what is your expected result with code edited based on this.
Best Regards
Maggie
- EricMEwald7 years agoRegular Visitor
Maggie,
The code is related to mr original question. I shows that exmaple, since it is an example where i would just add the code in advanced query editor.
My expected result would be a snipped of code i could just include in the query editor. In your resposne I do not know what to include after "last step" or "source".Here is my full code (i put ***** for parts that are identifiable of my organization). If possilbe id like some code i just can copy and paste in.
let
Source = AdobeAnalytics.Cubes([HierarchicalNavigation=true]),
***** = Source{[Name="*****"]}[Data],
***** = *****{[Id="*****"]}[Data],
#"Added Items" = Cube.Transform(*****,
{
{Cube.ApplyParameter, "DateRange", {#date(2018, 10, 15), #date(2018, 10, 26)}},
{Cube.ApplyParameter, "Top", {20000, "evar47"}},
{Cube.AddAndExpandDimensionColumn, "DateGranularity", {"year", "month", "day"}, {"Date Granularity.Level 1: Year", "Date Granularity.Level 2: Month", "Date Granularity.Level 3: Day"}},
{Cube.AddAndExpandDimensionColumn, "evar47", {"evar47"}, {"Order ID (v47)"}},
{Cube.AddMeasureColumn, "Revenue", "revenue"},
{Cube.AddMeasureColumn, "Shipping Revenue (e54)", "event54"},
{Cube.AddMeasureColumn, "Tax Revenue (e55)", "event55"}
}),
#"Merged Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Added Items", {{"Date Granularity.Level 2: Month", type text}, {"Date Granularity.Level 3: Day", type text}, {"Date Granularity.Level 1: Year", type text}}, "en-US"),{"Date Granularity.Level 2: Month", "Date Granularity.Level 3: Day", "Date Granularity.Level 1: Year"},Combiner.CombineTextByDelimiter("/", QuoteStyle.None),"Date"),#"Changed Type" = Table.TransformColumnTypes(#"Merged Columns",{{"Date", type date}})
in
#"Changed Type"