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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
frankegg
New Member

Creating a new table with rows containing substring in a column

Hi

 

I am very new to PowerBI queries, and hope someone can push me in the right direction 🙂

 

I have a table as shown below, named RoomTable.

frankegg_0-1668537164864.png

I will use this to create a similar table containing only the rows of type meeting room, and calculate capasity for these rooms only.

 

I have tried the folowing with no luck:

 

Meetingrooms =

FILTER (

'RoomTable'

CONTAINS ('RoomTable'), [Room], "Meeting")

)

 

Best regards,

 

Frank

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

Try to create a measure with the code below, then you shall be able to create your expected table visual with this measure:
Meetingrooms :=
CALCULATE(
     SUM('RoomTable'[Capacity]),
     FILTER (
         'RoomTable'
         CONTAINS (
            'RoomTable', 
            'RoomTable'[Room], 
            "Meeting"
          )
      )
)

View solution in original post

2 REPLIES 2
FreemanZ
Super User
Super User

Try to create a measure with the code below, then you shall be able to create your expected table visual with this measure:
Meetingrooms :=
CALCULATE(
     SUM('RoomTable'[Capacity]),
     FILTER (
         'RoomTable'
         CONTAINS (
            'RoomTable', 
            'RoomTable'[Room], 
            "Meeting"
          )
      )
)
daXtreme
Solution Sage
Solution Sage

In Power Query denormalize the table first. Each piece of info should be stored in a separate column. So, your room number in one column and the type of room in another. Then you'll be able to filter seamlessly. Filtering by a substring is not the best idea and not Best Practice. Not to mention it slows down DAX.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.