Forum Discussion

Krushnab85's avatar
Krushnab85
Helper I
10 months ago
Solved

Need help on creating calculated column

Hello Guys, Need a help for creating a calculated column as below "Required Output" Column Metric Name Product Sample Required Output AA Triangle 10 Triangle=10, Square = 20 AA S...
  • v-nmadadi-msft's avatar
    v-nmadadi-msft
    10 months ago

    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