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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
pbiforum123
Post Patron
Post Patron

Comma separated value for same rank in table

We have created the table with Rank like below.

 

pbiforum123_0-1665472018554.png

 

What Client is expecting is below. Instead of showing multiple rows for the same rank they want show only one row for the companies with same rank.

 

pbiforum123_1-1665472049904.png

 

Please note that Rank here is a measure(Rank with Dense).

Can someone help on this?

1 ACCEPTED SOLUTION

Thank you for your feedback, and please check the below picture and the attached pbix file whether it suits your requirement.

 

 

Jihwan_Kim_6-1665481751410.png

 


 

    Microsoft MVP
 

 

   


      If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


   


     
        LinkedInVisit my LinkedIn page
     

   


   


     
        Outlook BookingSchedule a short Teams meeting to discuss your question

     

   


 


View solution in original post

12 REPLIES 12
Samarth_18
Community Champion
Community Champion

Hi @pbiforum123 ,

 

You can write a measure as below:-

Measure_ = 
CONCATENATEX ( VALUES ( 'Table (2)'[Company] ), [Company], "," )

Samarth_18_0-1665472402652.png


Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

@Samarth_18 I tried this but it is not working can you please share the sample pbix file.

 

Please note that in our case Rank that you see here is a measure.

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new table.

 

Jihwan_Kim_0-1665472325124.png

 

 

New Table =
ADDCOLUMNS (
    DISTINCT ( Data[Rank] ),
    "@CompanyList", CALCULATE ( CONCATENATEX ( Data, Data[Company], ", " ) )
)

 


 

    Microsoft MVP
 

 

   


      If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


   


     
        LinkedInVisit my LinkedIn page
     

   


   


     
        Outlook BookingSchedule a short Teams meeting to discuss your question

     

   


 


@Jihwan_Kim We dont have Rank as a column. In our case it is a measure. In your case you are having it as a column?

 

Hi,

I tried to create a sample pbix file like below.

Please check whether it suits your requirement, or please share your sample pbix file's link with the desired result, and then I can try to look into it.

The below is for creating a new table.

 

Jihwan_Kim_0-1665476512722.png

 

 

New Table = 
VAR _ranktable =
    ADDCOLUMNS ( Data, "@Rank", RANKX ( Data, Data[Value],, DESC, DENSE ) )
VAR _newtable =
    ADDCOLUMNS (
        SUMMARIZE ( _ranktable, [@Rank] ),
        "@CompanyList",
            CONCATENATEX (
                FILTER ( _ranktable, [@Rank] = EARLIER ( [@Rank] ) ),
                Data[Company],
                ", "
            )
    )
RETURN
    _newtable

 

    Microsoft MVP
 

 

   


      If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


   


     
        LinkedInVisit my LinkedIn page
     

   


   


     
        Outlook BookingSchedule a short Teams meeting to discuss your question

     

   


 


@Jihwan_Kim  Thanks a lot for this. I will check and let you know..

 

Since we are creating the the table in the Power BI itself will it work if we apply filter in the Slicer?

Hi,

Thank you for your feedback.

I don't think it will work if the slicer is created in the visualization tab. In this case, I think table visualization has to be created, and this approach will be more suitable. But, because I do not know what types of slicer you are going to create, please try.

Thanks.


 

    Microsoft MVP
 

 

   


      If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


   


     
        LinkedInVisit my LinkedIn page
     

   


   


     
        Outlook BookingSchedule a short Teams meeting to discuss your question

     

   


 


@Jihwan_Kim  Thanks a lot for your help! Yes we need this table in the visual not in the query editor.  In the visual they may have slicer like quarter, year, brand, etc...

 

Sorry if I did not explain the requirement cleary at first.

 

Any idea how this can be achieve in the visuals using the DAX?

 

Is it even achievable?

Thank you for your feedback, and please check the below picture and the attached pbix file whether it suits your requirement.

 

 

Jihwan_Kim_6-1665481751410.png

 


 

    Microsoft MVP
 

 

   


      If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


   


     
        LinkedInVisit my LinkedIn page
     

   


   


     
        Outlook BookingSchedule a short Teams meeting to discuss your question

     

   


 


@Jihwan_Kim Thank you so much, it is working perfectly. Could you please do me one favour? Whenever you are free could you please add the comments with your code explain how it works. Though it is working I am getting how it is working. So would like to understand that.

Hi,

I tried to write a comment in the measure like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1665508976154.png

 


 

    Microsoft MVP
 

 

   


      If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


   


     
        LinkedInVisit my LinkedIn page
     

   


   


     
        Outlook BookingSchedule a short Teams meeting to discuss your question

     

   


 


@Jihwan_Kim Thanks a lot for this. Sure I will take a look tomorrow as I am little busy today.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.