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,
Just to ask about the way to take one column and create a new one with the values of the first column separated by DASHES?
Any one can advise me about the DAX statement to achive this request
I did ask about and I got an answere but, I have a new issue and it is related with the Matriz the CONCATENATEX read the whole data grid but I need to break and concatenate as the screenshot showns
Thanks
Solved! Go to Solution.
HI @Rigolleto
If you want to create a calculated column, and just want to show once for each COLUMN1, you need to add an index in edit queries, then add a calculated column as below:
output1 =
var _column1='Table'[COLUMN1]
var _firstrow= CALCULATE(MIN('Table'[Index]),FILTER('Table','Table'[COLUMN1]=_column1))
return
IF('Table'[Index]=_firstrow, CONCATENATEX( FILTER( 'Table', [COLUMN1] = EARLIER([COLUMN1]) ), [COLUMN2] ))
otherwise, you could just use this simple formula:
output2 =
CONCATENATEX( FILTER( 'Table', [COLUMN1] = EARLIER([COLUMN1]) ), [COLUMN2] )
Result:
Regards,
Lin
HI @Rigolleto
If you want to create a calculated column, and just want to show once for each COLUMN1, you need to add an index in edit queries, then add a calculated column as below:
output1 =
var _column1='Table'[COLUMN1]
var _firstrow= CALCULATE(MIN('Table'[Index]),FILTER('Table','Table'[COLUMN1]=_column1))
return
IF('Table'[Index]=_firstrow, CONCATENATEX( FILTER( 'Table', [COLUMN1] = EARLIER([COLUMN1]) ), [COLUMN2] ))
otherwise, you could just use this simple formula:
output2 =
CONCATENATEX( FILTER( 'Table', [COLUMN1] = EARLIER([COLUMN1]) ), [COLUMN2] )
Result:
Regards,
Lin
Perhaps:
Column =
VAR __Values =
CONCATENATEX(
DISTINCT(
FILTER(
ALL('Table'),
[COLUMN1] = EARLIER([COLUMN1)
)
),
[COLUMN2],
"-"
)
RETURN
__Values
Try:
ConcatenateX =
VAR CALC = CONCATENATEX(Table1; Table1[SUBCAT]; "-")
RETURN
IF(ISINSCOPE(Table1[CAT]); CALC; BLANK())
Which gets you:
Or, if you want to include the SUBCAT column in your table:
ConcatenateX with SUBCAT =
VAR calc = CALCULATETABLE(VALUES(Table1[SUBCAT]); ALLEXCEPT(Table1; Table1[CAT]))
RETURN
IF(ISINSCOPE(Table1[CAT]); CALCULATE(CONCATENATEX(calc; Table1[SUBCAT]; "-")); BLANK())
Which gets you:
Or, if you want to show what other SUBCATS are in the same CAT:
Other SUBCAT in CAT =
VAR calc = CALCULATETABLE(VALUES(Table1[SUBCAT]); ALLEXCEPT(Table1; Table1[CAT]))
VAR vals = VALUES(Table1[SUBCAT])
VAR newt = EXCEPT(calc; vals)
RETURN
CONCATENATEX(newt; Table1[SUBCAT]; "-")
Which gives you:
Proud to be a Super User!
Paul on Linkedin.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 66 | |
| 45 | |
| 43 | |
| 36 | |
| 23 |
| User | Count |
|---|---|
| 196 | |
| 125 | |
| 105 | |
| 77 | |
| 56 |