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 September 15. Request your voucher.

Reply
dw700d
Post Patron
Post Patron

using a measure to filter specific items

I have a table with multiple purchase orders .Each purchase order has multiple account codes. I would like to create a measure that only shows purchase orders that contain specific account codes. For example in the data set below I would only like to see purchase orders  that contain account codeS DEF & WXY. As a result this table should only show Purchase Order 1, 3 & 5. Can anyone help me create a measure that accomplishes this?

 

Purchase OrderAccount Code
1ABC
1DEF
2ABC
2GHI
3DEF
4JKL
4MNO
5PQR
5STU
5WXY

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @dw700d ,

 

Do you have a special purchase order list that you want to filter? The table is like

5.png

Create the relationship as follows

66.png

 

The filtered table is as follows. Account Code is from the main table and Purchase Order is from another table. Set the value of the purchase order in the filter is not blank.

6.png

 

 

 

Best Regards,

Stephen 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

5 REPLIES 5
dw700d
Post Patron
Post Patron

@ebeeryThank you for your prompt response. I would like the ability to see all the account codes affiliated with Purchase orders 1,3 & 5 . currently your approach limits me to just viewing  DEF & WXY. For example  I would like the new table to like  below

 

Purchase OrderAccount Code
1ABC
1DEF
3DEF
5PQR
5STU
5WXY
ebeery
Memorable Member
Memorable Member

@dw700d I must be missing something, or just not following what you're trying to do.

Can't you just alter the code like below?

FilterMeasure = 
IF(
    SELECTEDVALUE('Table (2)'[Purchase Order]) in {1, 3, 5},
    1
)

 

ebeery_0-1627001001773.png

 

ebeery
Memorable Member
Memorable Member

@dw700d you could create a filter measure such as below, and use it to filter a table visual.

FilterMeasure = 
IF(
    SELECTEDVALUE('Table (2)'[Account Code]) in {"DEF", "WXY"},
    1
)

 

ebeery_0-1626999900460.png

 

 

@ebeery  sorry I read you answer wrong. I see now that your approach would work. My challenge is I have over 1,000 purchase orders so putting each individual number in the measure would be difficult

Anonymous
Not applicable

Hi @dw700d ,

 

Do you have a special purchase order list that you want to filter? The table is like

5.png

Create the relationship as follows

66.png

 

The filtered table is as follows. Account Code is from the main table and Purchase Order is from another table. Set the value of the purchase order in the filter is not blank.

6.png

 

 

 

Best Regards,

Stephen Tao

 

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

 

 

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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