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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Niraj_vora0106
Helper III
Helper III

Exclude values

Hi community,

 

I have a doubt and need your help in creating a logic

 

In the below table I've Status, Plan ID and Plan_name

Status Plan IDPlan_name
11Aircel 1GB Data 15 days
41Aircel 1GB Data 15 days
31Aircel 1GB Data 15 days
81Aircel 1GB Data 15 days
91Aircel 1GB Data 15 days
22Tata 2GB Data 30 days
32Tata 2GB Data 30 days
62Tata 2GB Data 30 days
102Tata 2GB Data 30 days
13Jio 1.5GB 90 days
43Jio 1.5GB 90 days
63Jio 1.5GB 90 days
73

Jio 1.5GB 90 days

 

 

I've 3 plans: Aircel 1GB Data 15 daysTata 2GB Data 30 days and Jio 1.5GB 90 days

and their respective Status and Plan ID's.

 

I want to exclude those Plan_name in which Status = 3 is there and their values,

 

For eg: In Aircel 1GB Data 15 days plan, there is Status = 3, as it includes 3 and other Status values too it should not consider this plan. same for Tata 2GB Data 30 days.

Jio 1.5GB 90 days will be considered as there is no 3 value in Status.

 

Please help.

 

1 REPLY 1
lbendlin
Super User
Super User

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSAWPHzKLk1BwFQ3cnBZfEkkQFQ1OFlMTKYqVYnWglEyLUGBOhxoIINZZEqDECyoNwCEjCCKbC2ADVNfhVmBFUYWhAWAlQFmSVV2a+gqGeKVCJpQFqsOGWNcMra45bNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Status = _t, #"Plan ID" = _t, Plan_name = _t]),
    #"Grouped Rows" = Table.Group(Source, {"Plan_name"}, {{"Rows", each _, type table [#"Status "=nullable number, Plan ID=nullable number, Plan_name=nullable text]}}),
    #"Filtered Rows" = Table.SelectRows(#"Grouped Rows", each (not List.Contains([Rows][Status],"3")))
in
    #"Filtered Rows"

How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done".

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.