Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
I have a table with thousands of purchase orders .Each purchase order has multiple account codes. I would like to create a measure that only shows purchase orders that contain account codes DEF or WXY.
The original table is below
Purchase Order | Account Code |
1 | ABC |
1 | DEF |
2 | ABC |
2 | GHI |
3 | DEF |
4 | JKL |
4 | MNO |
5 | PQR |
5 | STU |
5 | WXY |
The new table with measure would only show Purchase order 1, 3 &5 because these orders contain DEF& WXY
| Purchase Order | Account Code |
| 1 | ABC |
| 1 | DEF |
| 3 | DEF |
| 5 | PQR |
| 5 | STU |
| 5 | WXY |
Solved! Go to Solution.
@dw700d solution is attached, look at PO and Account Code tables, ignore other tables in the file.
✨ Follow us on LinkedIn
Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@dw700d here are the steps to get it done:
first, create an Account Code table to be used in the slicer by using the following DAX expression. Change PO to the table name in your model.
Account Code = ALLNOBLANKROW ( PO[Account Code] )
2nd, add a following measure to filter the POs
Filter PO =
CALCULATE (
COUNTROWS ( PO ),
TREATAS (
VALUES ( 'Account Code'[Account Code] ),
'PO'[Account Code]
)
)
1 - Add a slicer with account code from the table created in step 1
2 - add a table visual, put PO and Account code from PO table
3 - add a visual level filter using the Filter PO measure
✨ Follow us on LinkedIn
Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@dw700d solution is attached, look at PO and Account Code tables, ignore other tables in the file.
✨ Follow us on LinkedIn
Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k Thank you for the help. are you able to show screenshots? im unable to download your dashboard due to restrictions on my laptop
@selimovd I don't think slicer and filter will work, I believe @dw700d want to see all the rows that contains selected account code in this case "DEF" and "WXY"
@dw700d You need to create disconnected tables for account code, use that for the slicer, and then use a measure to find out which PO contains that selected accounts code and then only shoe those ones.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hey @dw700d ,
why don't you just use a slicer:
Slicers in Power BI - Power BI | Microsoft Docs
Or the filter in the filter pane:
Format filters in Power BI reports - Power BI | Microsoft Docs