Forum Discussion
Rickterpstra
5 years agoRegular Visitor
Need help excluding certain rows based on value in another column
Hi all, I recently started using PowerBI and I am running into an issue now. I have a database full of offer/quotation data. I want to make a report that shows the number of accepted offers, d...
- 5 years ago
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXIB4rzSnBwgZWSgFKsTrWQEFTVECBkDmY6oQiZoeg3BoqZApj8QmyCEzNAUmoBFzYFMZyRRC6XYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [OfferID = _t, Status = _t, OriginalOfferID = _t, ClientID = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"OfferID", Int64.Type}, {"Status", type text}, {"OriginalOfferID", Int64.Type}, {"ClientID", Int64.Type}}), #"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([OriginalOfferID] = null) and ([Status] = "D")), #"Filtered Rows2" = Table.SelectRows(#"Filtered Rows", each Table.RowCount(Table.SelectRows(#"Changed Type", (inner)=> inner[Status]<>[Status] and inner[OriginalOfferID]=[OfferID]))=0) in #"Filtered Rows2"Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
- 5 years ago
I have no idea what you are doing. Works fine on my end. See attached
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Rickterpstra
5 years agoRegular Visitor
This doesn't help.
| OfferID | Status | OriginalOfferID | ClientID |
| 1 | D | null | 20 |
| 2 | D | 1 | 20 |
| 3 | A | 1 | 20 |
| 4 | D | null | 20 |
| 5 | O | 4 | 20 |
| 6 | D | null | 20 |
| 7 | C | null | 20 |
The first filter has 3 results: offer 1, 4 and 6.
However, the second filter does not eliminate offer 1 and 4. This on should not be counted as Denied because the second/third version was actually accepted or still outstanding.