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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Lorien
Frequent Visitor

Match/Look Up

Hi everyone

 

Can anyone please help me on the below? I am interested returning a positive result if a quote code contains Laverde Textile fabric as shown on the list below to the left AND that it also contains the Nova fabric as well. All rows come from the same table.

 

Lorien_0-1626062172445.png

 

Any help would be very much appreciated.

 

Thanks

Lorien

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Lorien 

I extracted part of the data you provided and created a simple sample .

Ailsamsft_0-1626243001254.png

Then create a measure like this :

Laverde-Nova check =
var _number=CALCULATE(COUNT('Table'[QuoteCode]),FILTER('Table','Table'[SupplierName]="Laverde Textile" && 'Table'[FabricName]="Nova"))
return IF(_number=0,"No","Yes")

First calculate the number of rows that meet the conditions, and then determine whether the number of rows is 0. If it is, it means that there are no values that meet the conditions. If it is not, then there are rows in the table that contain both "Laverde Textile" and "Nova".

I have attached my pbix file ,you can refer to it .

 

Best Regards

Community Support Team _ Ailsa Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi @Lorien 

I extracted part of the data you provided and created a simple sample .

Ailsamsft_0-1626243001254.png

Then create a measure like this :

Laverde-Nova check =
var _number=CALCULATE(COUNT('Table'[QuoteCode]),FILTER('Table','Table'[SupplierName]="Laverde Textile" && 'Table'[FabricName]="Nova"))
return IF(_number=0,"No","Yes")

First calculate the number of rows that meet the conditions, and then determine whether the number of rows is 0. If it is, it means that there are no values that meet the conditions. If it is not, then there are rows in the table that contain both "Laverde Textile" and "Nova".

I have attached my pbix file ,you can refer to it .

 

Best Regards

Community Support Team _ Ailsa Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Lorien , Create a new column like

 

 

new column =
var _cnt = Countx(filter(Table, [supplierName] ="Laverde Textile" && [FabricName] ="Nova" && [Quote] = ealier([Quote])),[Quote])
return
if(isblank(_cnt) , "No", "Yes")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Unfortunately the rows do not contain the same data so I may find one but not the other, I need it to check the rest of the table. I don't think this can be a calculated column for that reason but a measure? Can the above be adapted for a measure as I think that will work.

@Lorien , I think earlier should do that job in case of a new column

 

Measure can be

 

new measure =
var _cnt = Countx(filter(allselected(Table), [supplierName] ="Laverde Textile" && [FabricName] ="Nova" && [Quote] = max([Quote])),[Quote])
return
if(isblank(_cnt) , "No", "Yes")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you, we are almost there!

 

I changed the above measure to the below:

Laverde Nova Check =
var _cnt = Countx(filter(allselected(q3QuoteFeatureTreatment), [FabricSupplier] ="1394" && [FabricName] ="Nova" && [QuoteCode] = max([QuoteCode])),[QuoteCode])
return
if(isblank(_cnt) , "No", "Yes")
 
The reason for the "1394" is because it is the code for that supplier. The list of names of the suppliers comes from a seperate table. I have them linked together in the relationships by SupplierCode

 

However I think the use of that column broke the measure because of the below error:

 

Lorien_0-1626064646809.png

 

Should I merge the two tables together to resolve that or is there another way?

 

Thanks again in advance!

@Lorien , Try like

 

Laverde Nova Check =
var _cnt = Countx(filter(allselected(q3QuoteFeatureTreatment), [FabricSupplier] =1394 && [FabricName] ="Nova" && [QuoteCode] = max([QuoteCode])),[QuoteCode])
return
if(isblank(_cnt) , "No", "Yes")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

That fixed the measure so I don't get an error but I only get a No result whereas I know there is more than one quotecode with both options in it as per my original screen shot above.

 

I have filtered the below list by just drape and voile-sheer treatmentdescription but there are zero yes results even without the filter on:

 

Lorien_0-1626066365027.png

 

So something is not quite right somewhere as we know from the my first post that there are quotecodes with both options in them. Any other ideas please?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.