Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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,
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |