Forum Discussion
Custom Filtering
Can you tighten this up a bit? You haven't given us the raw data. You have given us an intermediate step that isn't working and explained that is is broken.
As far as your SelectRows function, it works fine here - not sure it is the results you want, but it functionally works and you can see it in the last statement.
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("ldG9CoMwFAXgV5HMgrk/mphNLAVLh1JKF+lQOglSly59+ybRgLEOOiTkQDjfjbatqDQXJFLBGWYIiTYkbUqmdRn67vVNwB7v3dA/P93w9qm+Nremrs72GO6DeKTzPuX6AA3qv3qVMpUb610MpeiJGiRL3wnsDTAAYyafpYEifgBGAsaCUnY7MbErUXoygPN1I8ozgyKDFob7CGFwVXrjCFAU+wyODF4YpTfGwbX0xsEaap+RR0YeG9rNHwbXsG7kRtKKgYRbFXc91Gr71x8/", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Incident ID" = _t, TIMESTAMP = _t, #"Start Time" = _t, Duration = _t, Policy = _t, Violation = _t, SEVERITY = _t, Index0 = _t, Prev.INCIDENT_ID = _t, Index1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"TIMESTAMP", type datetime}, {"Start Time", type datetime}, {"Duration", Int64.Type}}),
#"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([Duration]<> null and [Duration] <> "" or ([Incident ID] = [Prev.INCIDENT_ID])))
in
#"Filtered Rows"
How to use M code provided in a blank query:
1) In Power Query, select New Source, then Blank Query
2) On the Home ribbon, select "Advanced Editor" button
3) Remove everything you see, then paste the M code I've given you in that box.
4) Press Done
5) See this article if you need help using this M code in your model.
How to get good help fast. Help us help you.
How To Ask A Technical Question If you Really Want An Answer
How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.
Sorry, I've been away for a few days. I did not want to recreate the entirety of my work and dataset as example data because the previous steps have worked, but I will give it a go. It may take some time, though.
- v-kelly-msft5 years ago
Community Support
Hi Anonymous ,
Is your issue solved now?Have you checked my last reply?
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
- Anonymous5 years agoNot applicable
v-kelly-msft, it is not yet resolved. I did see your last. I've just circled back to this project this afternoon. I am going to spend some time dummying up the raw data more fully and trying to clean up the OG post to be more clear and useful, as suggested by edhans.
- v-kelly-msft5 years ago
Community Support
Hi Anonymous ,
But test here,it works fine,could you advise me where is the problem?
Best Regards,
KellyDid I answer your question? Mark my post as a solution!