First of i am nwe to power BI, tried to search, but could not find a solution.
I am running a direct query on a SQL.
In my database there is a file path colum. But in my slicer i Power BI i want to only show the file name. Is it possible ?
The file path looks like this:
In my slicer i woul like to only show:
Basiclly want to filter all left of the last \
Hope someone can help, thanks
Go to Solution.
if you weren't using Direct Query I would suggest solving this in M, but I think it's unlikely to work in this caseIn DAX you can create measure like this
Filename = MID(Table1[FileName],30,50)
it assumes that the folder path always has 30 charactersThis is more flexible, but less performant
SUBSTITUTE ( Table1[Filepath], "\", REPT ( " ", LEN ( Table1[Filepath] ) ) ),
LEN ( Table1[Filepath] )
most performant may be just adding the filename in your SQL source though
EDIT the second code will not work if the filenames have spaces in them
Proud to be a Datanaut!
View solution in original post
2. option worked perfekt.
Thanks a lot.
Will keep an eye on performance.
Join us in the third Triple A event!
It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.
Make sure you didn't miss any of the things that happened in the community in January!