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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
harsha449
Frequent Visitor

PATHITEM function to extract string from the URL

Hi,

 

I'm trying to extract string from the URL using PATHITEM function, it is working fine for DAX when the data is in excel.

 

Now I'm connect to direct query, i need to use DAX formula compatibilty in DirectQuery mode.

 

https://docs.microsoft.com/en-us/sql/analysis-services/tabular-models/dax-formula-compatibility-in-d...

 

Example:

 

URL: /country/english/pages/careers/article

 

I want to extract "careers" in new column.

 

DAX formula is working fine: PATHITEM(SUBSTITUTE(COLUMN,"/","|"),5)

 

Could you please help me with the function to do the same for direct query

 

Thanks

7 REPLIES 7
v-chuncz-msft
Community Support
Community Support

@harsha449,

 

To ensure that queries sent to the underlying data source have acceptable performance, limitations are imposed on measures by default. Advanced users can choose to bypass this limitation by selecting File > Options and settings > Options and then DirectQuery, then selecting the option Allow unrestricted measures in DirectQuery mode.

https://docs.microsoft.com/en-us/power-bi/desktop-use-directquery#limitations-of-directquery

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

i have turned on that option, it is still not working.

 

I have tried MID and SEARCH functions, I'm getting error message "Search" and "Find" are not allowed as part of calculated column DAX.

 

As per the link below: we need to use 4 argumnet instead of 2 argument.

 

http://community.powerbi.com/t5/Desktop/FIND-SEARCH-in-direct-query-mode/td-p/198993

 

I'm trying that option but still not luck.

@harsha449,

 

The nested FIND Function seems to work for me.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks Sam for looking into it.

 

=MID(H5,SEARCH("pages/",H5,1)+5,(SEARCH("/",H5,SEARCH("pages/",H5,1)+6)-(SEARCH("pages/",H5,1)+5)))

 

Could you please help in editing it.

 

to get "Careers" in new column.

 

Regards,

Sri

@harsha449,

 

Specify the fourth parameter NotFoundValue as well.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

When i try to use 4th parameter, I'm getting a error message saying i have used many arguments.

 

Thanks,

Sri

Hi Sam,

 

Could you please help me with this.

 

Thanks,

Sri

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.