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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Seems like a LOOKUPVALUE problem?

Hi experts,
I have a table 'poc_memberrecords'

I want to pick all the 'poc_memberrecordid' containing 'Cosmetics' in 'poc_departmentname'. (but not only containing 'Cosmetics' as the same 'poc_memberrecordid' may also have purchased 'restaurant' or 'cloth'...etc)
How should I do this?

 

poc_memberrecords

poc_memberrecordidpoc_departmentname
12345Supermarket
12340Restaurant
12349Cosmetic
12348Cosmetic
12348Cloth
12346Restaurant
12343Restaurant
12344Resaurant

 

The result I expected will be like this:

poc_memberrecordidpoc_departmentname
12349Cosmetic
12348Cosmetic
12348Cloth

Thanks!

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

Create a measure 

Measure = IF(NOT(ISERROR(FIND("Cosmetic",MAX([poc_departmentname])))),1,0)

Create a new table

Table =
VAR filtered1 =
    FILTER (
        SUMMARIZE ( poc_memberrecords, poc_memberrecords[poc_memberrecordid] ),
        [Measure] = 1
    )
RETURN
    FILTER ( poc_memberrecords, [poc_memberrecordid] IN filtered1 )

4.png

 

 

 

Best Regards

Maggie

 

View solution in original post

6 REPLIES 6
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

Create a measure 

Measure = IF(NOT(ISERROR(FIND("Cosmetic",MAX([poc_departmentname])))),1,0)

Create a new table

Table =
VAR filtered1 =
    FILTER (
        SUMMARIZE ( poc_memberrecords, poc_memberrecords[poc_memberrecordid] ),
        [Measure] = 1
    )
RETURN
    FILTER ( poc_memberrecords, [poc_memberrecordid] IN filtered1 )

4.png

 

 

 

Best Regards

Maggie

 

Ashish_Mathur
Super User
Super User

Hi,

 

The entries in the poc_departmentname of the first table are not in English.  The entries in the poc_memberrecordid column are absolutely different.  Neither do i understnad yoru question nor the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi,

I've revised it and it should be easier to understand now.

Hi,

 

I still do not understand.  In the first table there is supermarket appearing against 12345.  Why in the second table is there 12345 appearing 3 times with Cosmetics, Clothes and Restaurant.  I just do not understand.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

The second table:

poc_memberrecordidpoc_departmentname
12349Cosmetic
12348Cosmetic
12348Cloth

Hi,

 

See if my solution here helps - Filter a column of a Pivot Table on a certain condition but also show other items from that column.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Users online (4,368)