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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

How to concatenate values filtered by measure?

I'm working on a file where I have a hierarchical slicer and matrix visualization. In order to filter the matrix columns, I built a measure to check if all slicer criteria is met, which returns 1 or 0.

match_check = 
VAR NumOfSelectedAttrVal = DISTINCTCOUNT ( 'my_table'[ATTRIB_VALUE] ) 
VAR SelectedNumCols = 
    CALCULATE(
        DISTINCTCOUNT ( 'my_table'[ATTRIB_NAME] ) ,
        ALLSELECTED(my_table)
    )
VAR FiltersNotApplied = AND(ISFILTERED(my_table[ATTRIB_NAME])=false, ISFILTERED(my_table[ATTRIB_VALUE])=false)
VAR bool = IF(OR(NumOfSelectedAttrVal = SelectedNumCols, FiltersNotApplied = true), 1, 0)
RETURN
    bool

I apply the measure as a visual level filter to only show records where the match_check = 1

Then I'm able to count the matching records by summing the measure column.

Records = 
VAR match_record_count = 
    SUMX(SUMMARIZE(my_table,my_table[record_id],"measure",[match_check]),[measure])
var record_count = 
IF(match_record_count=0,
    IF(ISFILTERED(my_table[ATTRIB_VALUE]),
        match_record_count,
        DISTINCTCOUNT(my_table[record_id])),
    match_record_count)
return record_count

Now I want to concatenate the matching records to create a comma separated list, but I'm having trouble doing so. I thought that concatenating the filtered table would work, but I get 0 results when trying something like this:

record_list = 
    CONCATENATEX(
        FILTER(my_table,
        [match_check]=1),
        my_table[record_id],
        ",")

Is it possible in this case to concatenate the record_id values where the match_check = 1?

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Posting my own solution for others to see. I ended up creating a SUMMARIZE table with the match_check included and filtering on that:

record_list = 
   CONCATENATEX(
      FILTER(
         SUMMARIZE(my_table,
         my_table[record_id],
         "bool",
         [match_check]),
      [bool]=1),
   my_table[record_id],",")

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Posting my own solution for others to see. I ended up creating a SUMMARIZE table with the match_check included and filtering on that:

record_list = 
   CONCATENATEX(
      FILTER(
         SUMMARIZE(my_table,
         my_table[record_id],
         "bool",
         [match_check]),
      [bool]=1),
   my_table[record_id],",")

 

Thank you for sharing! Helped me as well!

v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

I believe it is possible to concatenate the record_id values but it would be better if you could provide some sample data or a sample file for us to test the measure.

 

And which visual is this measure put in? Is there other field in the same visual? If it returns 0 result, the FITLER part seems to return blank result which means no rows meet the slicer criteria in the current context. So you need to check how the slicer and other filters influence the visual currently. 

 

Maybe you can try adding ALL or ALLSELECTED to the current measure. 

record_list = 
    CONCATENATEX(
        FILTER(ALLSELECTED(my_table),
        [match_check]=1),
        my_table[record_id],
        ",")

 

Best Regards,
Community Support Team _ Jing

Anonymous
Not applicable

I ended up getting to my intended outcome by creating a table using SUMMARIZE and filtering that. See my own reply with the accepted solution. 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.

Top Solution Authors
Top Kudoed Authors