Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Rigolleto
Resolver I
Resolver I

Parsing a column base on filter values

 

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

 

Capture.PNG

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

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:

8.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

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:

8.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Community Champion
Community Champion

Perhaps:

 

Column = 
  VAR __Values = 
    CONCATENATEX(
      DISTINCT(
        FILTER(
          ALL('Table'),
          [COLUMN1] = EARLIER([COLUMN1)
        )
      ),
      [COLUMN2],
      "-"
    )
RETURN
  __Values


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
PaulDBrown
Community Champion
Community Champion

@Rigolleto 

 

Try:

 

 

ConcatenateX = 
VAR CALC = CONCATENATEX(Table1; Table1[SUBCAT]; "-")
RETURN
IF(ISINSCOPE(Table1[CAT]); CALC; BLANK())

 

 

Which gets you:

result.JPG

 

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:

result with subcat.JPG

 

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:Other subcats.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






amitchandak
Super User
Super User

So if display column1 along with this formula you will get output

Measure = CONCATENATEX (table,table[Column2])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.