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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Calculate one table into multiples based on first character(s) in a column

Been searching for hours and have not found a case that is close enough to what I am trying to do to help this PBI "noob."

 

I have a main data table (called "RAW") imported in Power BI. All fine, but I need to filter it into several other tables based on the starting characters of a few different columns. For most, a [Project Id} column is a 10-digit string that may start with a P,W, E, R, or a few others.

 

So for example, in one case Table1 = the entire RAW table, but only bringing over rows where the string in [Project Id} begins with a "W." 

 

There are a few cases where I need to AND together conditions from several columns, but in every case it's a "begins with" scenario (as opposed to "contains").

 

I am going down the path of CALCULATETABLE, but having trouble setting the filter conditions. Would this use a LEFT, and if so, how do you incorporate that into a CALCULATETABLE?

3 REPLIES 3
Anonymous
Not applicable

HI @Anonymous,

 

If you can please share some sample data with expected result to help use clarify your requirement. It is hard to coding formula based on your description.

 

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Since my data is huge I will use a highly-simplified example.


Say I start with a table named RAW that has these columns/rows:

 

 

A             B          C         D


P12345   39.42   1864    Pjlxt


R12345   89.32   54a3    Dlvt


P98765   75.32   09r5    Lsd.t

 


From this I would create two additional tables based on the first character in column A, so one table would look like this (forst character "P"):

 

 

A             B          C         D


P12345   39.42   1864    Pjlxt


P98765   75.32   09r5    Lsd.t

 

 

 

And the other would look like this (first character "R"):

 

 

A             B          C         D


R12345   89.32   54a3    Dlvt

 

Anonymous
Not applicable

HI @Anonymous,

 

Unfortunately, current both dax and m query not contains functions to generate multiple tables based on one table. You had to manually create these tables based on source data.

 

In my opinion, I'd like to suggest add calculated column to store first character, then use this data to create matrix table.(new column and column A to rows field, other column to value field)

Header =
LEFT ( [A], 1 )

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.