DAX Text - REPT function



Description

Repeats text a given number of times.

Syntax

REPT (<text>, <num_times>) 

Parameters

Sr.No. Parameter & Description
1

text

The text you want to repeat.

2

num_times

A positive number specifying the number of times to repeat the text.

Return Value

A text string.

Remarks

You can use DAX REPT function to fill a cell with a number of instances of a text string.

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

  • If number_times is not an integer, it is rounded.

  • If the result of the DAX REPT function is longer than 32,767 characters, an error is returned.

  • If you are using a text parameter directly, enclose it in double quotes.

Example

= REPT ("55",2) returns 5555. 
= REPT (55,2) returns 5555. 
= REPT("AB",5) returns ABABABABAB. 
= REPT("AB",2.2) returns ABAB. 
= REPT("AB",2.5) returns ABABAB. 
= REPT("AB",0) returns Blank.
dax_functions_text.htm
Advertisements