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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
Super User
Super User

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

FreemanZ
Super User
Super User

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
Super User
Super User

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors