Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How to create display column for multi-select choice?

Using CDS as data source to create Power BI graphs. In the data tables, there is a display column that can show the value of the choice ID selected for single-select choice columns in each row. It is created from the data source. For example,

fieldnamefieldname_display
0A
1B
2C
3D
4E

How can it be created for multi-select choices?

Such as,

fieldname(multi)fieldname(multi)_display
0,1A,B
1,2,3B,C,D
3,4D,E
0A,B
2,3C,D

 

It will only display the left column, to show the choice IDs selected, with a comma to separate the values. How can it be done but to show the values of the choice IDs?

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

    Please follow the below steps to get it, you can open the attachment to check how it works...

    1. Select the table and right click "New measure" just as below screenshot

    2. Write the below formula in the formula bar

    FieldName_Display(Multi) = 
    CONCATENATEX (
        FILTER ( 'Table', 'Table'[fieldname] IN ALLSELECTED ( 'Table'[fieldname] ) ),
        'Table'[fieldname_display],
        ","
    )

    3. Apply the above measure onto the table visual

    Best Regards

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    You can create a measure as below to get it, please find the details in the attachment.

    FieldName_Display(Multi) = 
    CONCATENATEX (
        FILTER ( 'Table', 'Table'[fieldname] IN ALLSELECTED ( 'Table'[fieldname] ) ),
        'Table'[fieldname_display],
        ","
    )

    Best Regards

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous , thanks for this solution. However my data table does not have the _display column to begin with, do you know how to create this multi choice _display column in the table? 

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,

        Please follow the below steps to get it, you can open the attachment to check how it works...

        1. Select the table and right click "New measure" just as below screenshot

        2. Write the below formula in the formula bar

        FieldName_Display(Multi) = 
        CONCATENATEX (
            FILTER ( 'Table', 'Table'[fieldname] IN ALLSELECTED ( 'Table'[fieldname] ) ),
            'Table'[fieldname_display],
            ","
        )

        3. Apply the above measure onto the table visual

        Best Regards