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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.