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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.