Table of contents
TOC
Collapse the table of content
Expand the table of content

REPT Function (DAX)

Owen Duncan|Last Updated: 5/22/2018

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

Syntax

REPT(<text>, <num_times>)  

Parameters

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

Property Value/Return Value

A string containing the changes.

Remarks

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.

Example: Repeating Literal Strings

Description

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

Code

=REPT("85",3)  

Example: Repeating Column Values

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

See Also

Text Functions (DAX)

© 2018 Microsoft