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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
sumpekung
Frequent Visitor

Filter out the data when the conditions are not fully match

Hi,

 

I'm trying to sort some rows out if those rows not match all conditions.

 

I need to compare the defect by date between 2 operations but I want to compare only the lot that already pass both operations. Is there any way to sort the rows out via power query or measure function?

 

sumpekung_0-1674716558702.png

 

Thanks,

 

1 ACCEPTED SOLUTION

Hi @olgad ,

Thanks again krub. I already fix the issue. I create MAX Operation column by power query and sort the operation#1 out and use measure as below.

Test Count = If(If(CALCULATE(Count('Table'[Lot]), 'Table'[Operation] = 2) > 0 ,1,0)=1, Sum('Table'[Defect]))

sumpekung_0-1675042513139.pngsumpekung_1-1675042569840.png

sumpekung_2-1675042761143.png

 

 

View solution in original post

8 REPLIES 8
wdx223_Daniel
Community Champion
Community Champion

OperationCount=CALCULATE(DISTINCTCOUNT(Table[Operation]),ALLEXCEPT(Table,Table[Date],Table[Lot]))

FreemanZ
Community Champion
Community Champion

hi @sumpekung 

 

not sure if i fully get you, you may try to add a measure like this:

measure = COUNTROWS(VALUES(TableName[Operation]))

 

you may plot a table visual with Lot column and the measure, like this:

FreemanZ_0-1674737466022.png

 

or you can feed filter pane for a visual with the measure and show the items when the value is 2, like this:

FreemanZ_1-1674737556790.png

 

My whole data table contains many rows for each lot and not same row quantity in each lot, so it doesn't work with ny data.
Thank you in advance krub @FreemanZ .

hi @sumpekung 

then could you update your sample date to fully refect the issue?

Thank you in advance for follow up with a great support krub. Anyway, I already fixed my problem with the idea from you and @olgad .

olgad
Resident Rockstar
Resident Rockstar

Hi, 
New Count=

If(If(CALCULATE(Count(Table[lot]), Table[Operations] = 1) = CALCULATE(Count(Table[lot]), Table[Operations] = 2),1,0)=1, Sum(Table[Defect]))
olgad_0-1674737190837.png

Please kudo and like the solution if it works for you. 


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

Hi @olgad ,

Thanks again krub. I already fix the issue. I create MAX Operation column by power query and sort the operation#1 out and use measure as below.

Test Count = If(If(CALCULATE(Count('Table'[Lot]), 'Table'[Operation] = 2) > 0 ,1,0)=1, Sum('Table'[Defect]))

sumpekung_0-1675042513139.pngsumpekung_1-1675042569840.png

sumpekung_2-1675042761143.png

 

 

Thanks @olgad , sorry for the less information I provide. My data set contains multiple days, then it still sum defect from all lots I have. Now I'm trying to adapt your idea if it can work.

sumpekung_0-1674790316978.png

sumpekung_1-1674790329570.png

 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.