REPT

Updated on

REPT is a DAX function that repeats a text string a specified number of times.

Syntax

REPT(
   Text,
   NumberOfTimes
)
Argument Properties Description
Text The text you want to repeat.
NumberOfTimes A positive number specifying the number of times to repeat text.

Return Values

A string containing the changes.

Remarks

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

  • If num_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

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

= REPT("85",3)

Example: Repeating Column Values

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.

= REPT([MyText],[MyNumber])
MyText MyNumber CalculatedColumn1
Text 2 TextText
Number 0
85 3 858585

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/dax/rept-function-dax

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy