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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
PowerBI123456
Post Partisan
Post Partisan

Searching for Combos

I am trying to identify if an account has specific code combination(s). I have 2 tables, one showing codes by account: 

 

PowerBI123456_0-1599574265351.png

 

The second table showing different code combinations:

PowerBI123456_1-1599574291565.png

I need to see if an account has any of the code combinations and which ones, so it should look like this:

 

Capture.PNG

 

Any help would be appreciated. I am also dealing with a lot of rows (1,000,000 +). Thanks!

 

 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@PowerBI123456 - I did it this way:

Measure 5 = 
    VAR __Codes = SELECTCOLUMNS('Table (5)',"Code",[Code])
    VAR __Table = FILTER('Table (5a)',[Code 1] IN __Codes && [Code 2] IN __Codes)
RETURN
    CONCATENATEX(__Table,[Code 1] & "&" & [Code 2],", ")

PBIX is attached below sig, Page 5, Table (5) and Table (5a)



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@PowerBI123456 - I did it this way:

Measure 5 = 
    VAR __Codes = SELECTCOLUMNS('Table (5)',"Code",[Code])
    VAR __Table = FILTER('Table (5a)',[Code 1] IN __Codes && [Code 2] IN __Codes)
RETURN
    CONCATENATEX(__Table,[Code 1] & "&" & [Code 2],", ")

PBIX is attached below sig, Page 5, Table (5) and Table (5a)



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@PowerBI123456 , Can you explain the logic behind it.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@amitchandak hi - what do you mean? That last table is what I am trying to get to in Power BI. I am just trying to see at the account level, if has any of the code combinations from the second table and which ones. Thanks!

Hi @PowerBI123456 ,

 

Have you resolved it? If yes, please accept the helpful answer as solution. Others will benefit from this thread. Thanks! If you still need help, please feel free to ask us.

 

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

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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