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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Pmorg73
Post Patron
Post Patron

Filtering by first letter of job number

Hi I am a newbie, so bear with me

 

I have a table of jobs. The fee earning jobs are pure numbers, ie 1904-2005.

My admin tasks all start with a J, ie J00001 = Admin (several of these)

My job proposals all start with P, ie P1906-2006

 

I am assuming I need measures to be able distinguish totals, count type functions to the 3 distinct groups? How do I for example sum all time spent on "P" prefixed jobs? 

It is easy to filter individual tables/visuals for the prefix, but I will need to use the total values for each in other reports later on.

 

Side note: I tried to prefilter the data tables into 3 different tables with the same columns and to build a relationship between them, but I always fail once I get more than 2 tables. Any good guidence on relationships out there? I find it baffling that my relationships fall down

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Pmorg73 

No. That is DAX.

Right click the table name and add new column.

Thanks

A

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @Pmorg73 

Create a new column with the first character.

Then use it in your filters.

e.g

First_Char = LEFT(Task_Code, 1) 

 

After that use in your measures.

Calculate(Countrows(Table), Filter(Table, First_Char = "J"))

Thanks!
A

The first bit did not work? Expression.Error: The name 'LEFT' wasn't recognized. Make sure it's spelled correctly


@Anonymous wrote:

Hi @Pmorg73 

Create a new column with the first character.

Then use it in your filters.

e.g

First_Char = LEFT(Task_Code, 1) 

 

After that use in your measures.

Calculate(Countrows(Table), Filter(Table, First_Char = "J"))

Thanks!
A



@Anonymous wrote:

Hi @Pmorg73 

Create a new column with the first character.

Then use it in your filters.

e.g

First_Char = LEFT(Task_Code, 1) 

 

After that use in your measures.

Calculate(Countrows(Table), Filter(Table, First_Char = "J"))

Thanks!
A


 

Anonymous
Not applicable

Hey @Pmorg73 

It is hard to guess what you have done.

It works perfectly for me.

2019-08-06 14_18_20-papercut - Remote Desktop Connection.png

 

Thanks!
A


@Anonymous wrote:

Hey @Pmorg73 

It is hard to guess what you have done.

It works perfectly for me.

2019-08-06 14_18_20-papercut - Remote Desktop Connection.png

 

Thanks!
A



Am I adding this to the table in query editor? 

Anonymous
Not applicable

@Pmorg73 

No. That is DAX.

Right click the table name and add new column.

Thanks

A

that was where I was falling. I did it in query editor and Left is not a function in there. Thanks buddy

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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