cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to Capitalize only the Initial letters in DAX

I have an Existing Column in the Model with Datatype TEXT. I need to create a Calculated Column with Intial Letter as Capital... Is that possible in DAX...? If so How to do that...?

I have row like : "JUST for An example"   ---- Need not to be only 4 words, they might be in between 1 and 6

I need the row to be look like this : "Just For An Example"... I want Intial letter of every word to be Capital....

 

8 REPLIES 8
Rygaard
Resolver I
Resolver I

you cant do that in 1 operation

1) Lowercase all

2) split column by 1 characther (only 1 split)

3) Capital all in first colum (containing only 1 char)

4) merg the two columns

kankas3
Regular Visitor

You have to use some workaround solution. When you have this kind of requirement, break that into smaller pieces and resolve those pieces one by one. Ultimately you can consolidate those solutions to get your final answer. 

 

Selected Month is like "FY23 M04 AUG" (Financial Month). So, this variable has "JAN", "FEB" but following DAX change "JAN" as "Jan", "FEB" as "Feb" etc...

 

Concatenate( Left(Right(_Selected_Month, 3 ),1),
Concatenate( Lower(Right(Right(_Selected_Month, 3 ),2)),
 
var _Consolidate_Report_Heading =
Concatenate( "Macro & Micro Metrics - Supplier ( ",
Concatenate( Left(Right(_Selected_Month, 3 ),1),
Concatenate( Lower(Right(Right(_Selected_Month, 3 ),2)),
Concatenate( " MOR snapshot ) as of ",
Calculate( Max( 'Last Refreshed Date'[Date Last Refreshed] ))))))
fsolarino
Advocate I
Advocate I

Try this out:

 

 

UPPER(LEFT([your_string];1)) & right([your_string]; len([your_string])-1)
aznariy
Advocate I
Advocate I

I don't think this question was answered properly according to the title of the question (in DAX, not in PowerrBi user interface). 

 

I am using measure and would like to capitalize the word, but UPPER function makes all the letter in the word capital.  

 

What is the proper way to capitalize a single word (not values in a column) using DAX language in PowerBi? 

Anonymous
Not applicable

Hi @Anonymous,

 

Why not use Power Query / M to do this task? There is a quick and simple way to achieve that by using lowercase + Capitalize Each Word transformations.

 

Format transformations in Power QueryFormat transformations in Power Query

 

HTH,

Pawel

Anonymous
Not applicable

I am importing the table directly from SQL Server to SSAS Tabular model and then to Live connected Power BI so I have to Capitalise Initials in SSAS tabular model by using DAX...


@Anonymous wrote:

I am importing the table directly from SQL Server to SSAS Tabular model and then to Live connected Power BI so I have to Capitalise Initials in SSAS tabular model by using DAX...


@Anonymous

AFAIK, there's no such existing function to do that in DAX. You may do the trick when importing from SQL Server via T-SQL. See some this demo and this.

Anonymous
Not applicable

Thanks... 

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Dev Camp Session 30

Ted's Dev Camp - January 26, 2023

This session will provide guidance and teach campers the skills required to build Power BI reports that support multiple languages.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.