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

Join 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.

Reply
maryg
Frequent Visitor

Creating a calculated table, from unrelated tables AND a substring extract

Hi - I am struggling to find an efficient way to create a data set from 2 unrelated tables (they cannot be related), with an extract of substring.  I am able to successfully pull the substring using this, but it literally takes days to run for only 30k rows.  I would love some advice to make this more efficient.  Thanks!

maryg_0-1723649079605.png

 

2 ACCEPTED SOLUTIONS
rajendraongole1
Super User
Super User

Hi @maryg - If the tables are large and the matching process is slow due to the dataset size, consider breaking down your dataset into smaller chunks and processing them separately.  also please share the sample data for review .

you can try below approach with variables and check once.

 

NPNextract =
VAR SearchText = 'August52024'[Case Narrative]
VAR NPNList = 'RTS_IVL_06_25_2024'[NPN]

RETURN
MAXX(
FILTER(
ADDCOLUMNS(
NPNList,
"IsMatch", CONTAINSSTRING(SearchText, [NPN])
),
[IsMatch]
),
[NPN]
)

 

Hope this helps.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

Anonymous
Not applicable

Hi @maryg ,

 

Thanks rajendraongole1  for the quick reply. I have some other thoughts to add:
Based on your DAX it looks like you are creating a calculated column.
Measures have better performance as compared to calculated columns, please create a measure according to the following formula.

MEASURE =
CALCULATE (
    MAX ( 'RTS_IVL_06_25_2024'[NPN] ),
    FILTER (
        'RTS_IVL_06_25_2024',
        CONTAINSSTRING (
            MAX ( 'August52024'[Case Narrative] ),
            'RTS_IVL_06_25_2024'[NPN]
        )
    )
)

vtangjiemsft_0-1723775186470.png

vtangjiemsft_1-1723775206891.png

Best Regards,

Neeko Tang

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

2 REPLIES 2
Anonymous
Not applicable

Hi @maryg ,

 

Thanks rajendraongole1  for the quick reply. I have some other thoughts to add:
Based on your DAX it looks like you are creating a calculated column.
Measures have better performance as compared to calculated columns, please create a measure according to the following formula.

MEASURE =
CALCULATE (
    MAX ( 'RTS_IVL_06_25_2024'[NPN] ),
    FILTER (
        'RTS_IVL_06_25_2024',
        CONTAINSSTRING (
            MAX ( 'August52024'[Case Narrative] ),
            'RTS_IVL_06_25_2024'[NPN]
        )
    )
)

vtangjiemsft_0-1723775186470.png

vtangjiemsft_1-1723775206891.png

Best Regards,

Neeko Tang

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

rajendraongole1
Super User
Super User

Hi @maryg - If the tables are large and the matching process is slow due to the dataset size, consider breaking down your dataset into smaller chunks and processing them separately.  also please share the sample data for review .

you can try below approach with variables and check once.

 

NPNextract =
VAR SearchText = 'August52024'[Case Narrative]
VAR NPNList = 'RTS_IVL_06_25_2024'[NPN]

RETURN
MAXX(
FILTER(
ADDCOLUMNS(
NPNList,
"IsMatch", CONTAINSSTRING(SearchText, [NPN])
),
[IsMatch]
),
[NPN]
)

 

Hope this helps.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.