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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
SandeA
Helper III
Helper III

Creating tables

I have a table that has columns of Date, FileName, DatabaseName, and Size. Some of the FileName fields have a "_log" at the end of the name. I'm trying to split this table into two separate tables: one for the regular databases and one for the log files.

 

I thought I was creating the first one using the below. However, I realize that just returned all the same data, it did not filter out the file names that have _log. 😞  

 

DatabaseInfo = SELECTCOLUMNS(FILTER(Servers,NOT(RIGHT(Servers[Filename]) = "_log")),
"Date", Servers[Date],
"File Name", Servers[FileName],
"Database", Servers[DatabaseName],
"Size", Servers[Size])

 

Logically, I figured if I removed the word "NOT" it would then create a table for those that contained "_log". I was wrong!  I don't get an error but the table is empty.  I haven't been in the DAX world for a while and my brain is totally overthinking this. Help! 🙂

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@SandeA,

 

You're missing the second parameter of the RIGHT function that specifies the number of characters.

 

DatabaseInfo =
SELECTCOLUMNS (
    FILTER ( Servers, NOT ( RIGHT ( Servers[Filename], 4 ) = "_log" ) ),
    "Date", Servers[Date],
    "File Name", Servers[FileName],
    "Database", Servers[DatabaseName],
    "Size", Servers[Size]
)

 

You can also do this in Power Query. Create a query that references the main query, and filter using "does not end with":

 

DataInsights_1-1658262490852.png

 

 





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
SandeA
Helper III
Helper III

@DataInsights I knew it had to be something simple that I was missing!! Thank you!!!

DataInsights
Super User
Super User

@SandeA,

 

You're missing the second parameter of the RIGHT function that specifies the number of characters.

 

DatabaseInfo =
SELECTCOLUMNS (
    FILTER ( Servers, NOT ( RIGHT ( Servers[Filename], 4 ) = "_log" ) ),
    "Date", Servers[Date],
    "File Name", Servers[FileName],
    "Database", Servers[DatabaseName],
    "Size", Servers[Size]
)

 

You can also do this in Power Query. Create a query that references the main query, and filter using "does not end with":

 

DataInsights_1-1658262490852.png

 

 





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

Proud to be a Super User!




Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.