REPT Function (DAX)

 

Repeats text a given number of times. Use REPT to fill a cell with a number of instances of a text string.

REPT(<text>, <num_times>)  

Parameters

TermDefinition
textThe text you want to repeat.
num_timesA positive number specifying the number of times to repeat text.

A string containing the changes.

If number_times is 0 (zero), REPT returns a blank.

If number_times is not an integer, it is truncated.

The result of the REPT function cannot be longer than 32,767 characters, or REPT returns an error.

Description

The following example returns the string, 85, repeated three times.

Code

=REPT("85",3)  

Description

The following example returns the string in the column, [MyText], repeated for the number of times in the column, [MyNumber]. Because the formula extends for the entire column, the resulting string depends on the text and number value in each row.

Code

=REPT([MyText],[MyNumber])  

Comments

MyTextMyNumberCalculatedColumn1
Text2TextText
Number0
853858585

Text Functions (DAX)

Community Additions

ADD
Show: