Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi there,
I am trying to print values for a specific column. for example the column name is ABC and it is occured 18 times for a key, the output needs to be as per below.
Cheers,
// Assumption is that you've got a table T
// where the structure is more or less this:
// Key | Column
// ----------------
// 1 | ABC
// 1 | ABC
// 2 | XYZ
// 2 | XYZ
// 2 | XYZ
// ...
// From your sample it looks like a key
// can only have one distinct value in
// the Column column.
[Output] =
IF(
// make sure that only one Key is
// visible in the current context
// and it's filtered directly.
HASONEFILTER( T[Key] ),
// The below will only work correctly
// if the assumption above is in force.
// Otherwise, SELECTEDVALUE will return
// BLANK() and you'll end up with a string
// of delimiters only or just an empty
// string.
var __numOfVals = COUNTROWS( T )
var __columnVal = SELECTEDVALUE( T[Column] )
var __ouput =
CONCATENATEX(
GENERATESERIES(1, __numOfVals, 1),
__columnVal,
":|"
)
return
__output
)
And, of course, [Output] is a MEASURE, not a calc column.
Best
D
Thanks @Anonymous The below measure works well.
I want to add one more column which is a unique number for each "ABC" value.
Cheers,
Rutika
Hi @Anonymous
I want to add one more column in the concatenate e.g.
What's wrong with using REPT() ?
Include the delimiter in the call to REPT and throw away the last character of the result.
Because it's fun, and an opportunity to test a function I didn't even know until very recently.
Hi Amit,
Basically I want to concatenate the output the number of times it appears as per the column headers.
Hopefully this explains !
Cheers,
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 32 | |
| 20 | |
| 12 | |
| 11 |