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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Krushnab85
Helper I
Helper I

Need help on creating calculated column

Hello Guys, Need a help for creating a calculated column as below "Required Output" Column

Metric NameProductSampleRequired Output
AATriangle10Triangle=10, Square = 20
AASquare20Triangle=10, Square = 20
BBTriangle30Triangle=30, Square = 40, Circle = 50
BBSquare40Triangle=30, Square = 40, Circle = 50
BBCircle50Triangle=30, Square = 50, Circle = 50
CCRectangle60Rectangle = 60, Triangle = 70
CCTriangle70Rectangle = 60, Triangle = 70

 

1 ACCEPTED SOLUTION

Hi @Krushnab85 ,

Please wrap your table filter inside a Distinct function, this way you will get the desired output.

Required Output 2 = 
VAR MetricGroup = 'Table'[Metric Name]
RETURN
CONCATENATEX (
    DISTINCT (
        SELECTCOLUMNS (
            FILTER ( 'Table', 'Table'[Metric Name] = MetricGroup ),
            "Product", 'Table'[Product],
            "Sample", 'Table'[Sample]
        )
    ),
    [Product] & " = " & [Sample],
    ", "
)

 

 

Uploading the sample .pbix file for reference.
 

 

I hope this information helps. Please do let us know if you have any further queries.
Thank you


View solution in original post

7 REPLIES 7
v-nmadadi-msft
Community Support
Community Support

Hi @Krushnab85 

As we haven’t heard back from you, we wanted to kindly follow up to check if the suggestions  provided by the community members for the issue worked. Please feel free to contact us if you have any further questions.

 

Thanks and regards

srlabhe
Helper V
Helper V

Try below DAX 

Products Concatenated =
VAR AllProducts =
CALCULATETABLE(
VALUES('Products'[Product Name]),
ALL('Metrics')
)
RETURN
CONCATENATEX(
AllProducts,
'Products'[Product Name],
", "
)

v-nmadadi-msft
Community Support
Community Support

Hi @Krushnab85 

May I check if this issue has been resolved? If not, Please feel free to contact us if you have any further questions.


Thank you

v-nmadadi-msft
Community Support
Community Support

Hi @Krushnab85 
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.


Thank you.

rohit1991
Super User
Super User

Hi @Krushnab85 

1. Create the Calculated Column.We want a column that shows all Product = Sample values for each Metric Name group.

  • In Data view, go to Modeling >> New column.
  • Enter this DAX:
Required Output =
VAR MetricGroup = 'Table'[Metric Name]
RETURN
CONCATENATEX (
   FILTER (
      'Table',
       'Table'[Metric Name] = MetricGroup
   ),
   'Table'[Product] & " = " & 'Table'[Sample],
   ", "
)

2. Outcome:

image.png

 

 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

It worked for what i have provided but in real world secanario i need unique product names across the metric name groups - 
for example -

CCRectangle60Rectangle = 60
CCRectangle60Rectangle = 60

Hi @Krushnab85 ,

Please wrap your table filter inside a Distinct function, this way you will get the desired output.

Required Output 2 = 
VAR MetricGroup = 'Table'[Metric Name]
RETURN
CONCATENATEX (
    DISTINCT (
        SELECTCOLUMNS (
            FILTER ( 'Table', 'Table'[Metric Name] = MetricGroup ),
            "Product", 'Table'[Product],
            "Sample", 'Table'[Sample]
        )
    ),
    [Product] & " = " & [Sample],
    ", "
)

 

 

Uploading the sample .pbix file for reference.
 

 

I hope this information helps. Please do let us know if you have any further queries.
Thank you


Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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