The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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 Order | Account Code |
1 | ABC |
1 | DEF |
2 | ABC |
2 | GHI |
3 | DEF |
4 | JKL |
4 | MNO |
5 | PQR |
5 | STU |
5 | WXY |
Solved! Go to Solution.
Hi @dw700d ,
Do you have a special purchase order list that you want to filter? The table is like
Create the relationship as follows
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.
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.
@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 Order | Account Code |
1 | ABC |
1 | DEF |
3 | DEF |
5 | PQR |
5 | STU |
5 | WXY |
@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
)
@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 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
Hi @dw700d ,
Do you have a special purchase order list that you want to filter? The table is like
Create the relationship as follows
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.
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.
User | Count |
---|---|
69 | |
69 | |
66 | |
54 | |
28 |
User | Count |
---|---|
112 | |
82 | |
66 | |
48 | |
43 |