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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Need help - DAX

Hi,

 

Does anyone know how I can create this with DAX code?:

1) Match values from two columns

2) If true, then the matching values should return 5 if they have an activity that starts with PO (from a column) and have a number that starts with 1,2, or 3 from another column. All of these columns are in the same table.

 

Please help.

Thank you!

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

 

it would be really helpful, if you create an xlsx file, that contains some sample data, and also a column with the expected result.

 

Upload the xlsx to onedrive or dropbox and share the link. Providing sample data reduces the effort to create a working solution and also helps to avoid misunderstandings. 

 

Creating a calculated column you might consider the following DAX functions

Check if the length of both column equals if the value of column 1 is in column 2, if this is the case check if the first 2 characters are PO ...

 

Hopefully this gets you started.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

3 REPLIES 3
TomMartens
Super User
Super User

Hey,

 

it would be really helpful, if you create an xlsx file, that contains some sample data, and also a column with the expected result.

 

Upload the xlsx to onedrive or dropbox and share the link. Providing sample data reduces the effort to create a working solution and also helps to avoid misunderstandings. 

 

Creating a calculated column you might consider the following DAX functions

Check if the length of both column equals if the value of column 1 is in column 2, if this is the case check if the first 2 characters are PO ...

 

Hopefully this gets you started.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

Hi @TomMartens

 

Thank you so much. Here is my Power BI file. 

 

https://www.dropbox.com/s/zi7f6cnuvx3j5n2/DAX.pbix?dl=0

Hey,

 

thanks for providing the sample data, but I'm missing a column "expected result" in one of the two tables.

 

Can you please describe how the formula should work.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.