Skip to main content

How can we repeat the value of a measure or column?

Table of Contents

n Power BI, you can repeat value for measure and column by using REPT function within another measure or column. This function will duplicate text however many times you want specified for it; thereby a cell can be filled with several instances of a text string.

<text> is the REPT function.


<text> Syntax REPT

Here is what its parts break down to:

<text>: The text to be repeated.

<text>: The text you want to repeat.


<text>: The text you want to repeat.


<text>: The text you want to repeat.


<text>: The text you want to repeat.


<text>: The text you want to repeat.


<user>
<text> so that is what each component of <text> means

<text>: That’s what each part of <text> means.


<text>: That’s what each part of <text> means.


<text>: That’s what each part of <text> means.


<text>: That’s what each part of <text> means.


<text>: That’s what each part of <text> means.


<text>: That’s what each part of <text> means.


<text>: That’s what each part of <text> means.


<text>: That’s what each part of <text> means.


<text>: That’s what each part of <text> means.
<num_times>: A positive number, indicating how many times the text is being repeated. If <num_times> is 0, then REPT shall return an empty cell. Besides, if <num_times> is not an integer, it will be rounded off to the nearest lower integer. The result of the REPT function will not be more than 32,767 characters; an attempt for it will result in an error.
Example:

You can also use CONCATENATEX and GENERATESERIES combination

Example

Where:

  • GENERATESERIES(1, 5) generates a series of numbers from 1 to 5.
  • “A” is the text you want to repeat.
  • “, “ is the delimiter that you want to use between the repeated values in order to separate them.

This formula concatenates the text “A” five times, with commas and spaces separating each repetition. You can replace “A” with any text or column name you want to repeat.

Add comment