cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
xanhdieu Visitor
Visitor

Summarizecolumns with rename of column

I want to rename the column to something else with DAX below. 

 

the cntry_code column to "Country Name".

 

EVALUATE
    SUMMARIZECOLUMNS (
        OPTMZ_GRP[cntry_code],
        "column a", SUM ('hcec_sales'[total_sales] )
    )

I've tried the addsolumns but that gave me 2 of the same columns.

 

EVALUATE
 ADDCOLUMNS(
    SUMMARIZECOLUMNS (  
        OPTMZ_GRP[cntry_code],
        ),
        "total_sales", SUM ('hcec_sales'[total_sales] )
    ),
    "Country Name", OPTMZ_GRP_BR_CURR_AIRPT[cntry_iso_cde]
)

cntry_code | total_sales | country Name

USA                 $150          USA 

 

is there a way to rename the column with just one column display?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Summarizecolumns with rename of column

HI @xanhdieu,

 

I think SELECTCOLUMNS function will suitable for your requirement, it support to extract specific columns and rename them at same time.

New Table =
SELECTCOLUMNS (
    SUMMARIZECOLUMNS (
        OPTMZ_GRP[cntry_code],
        "total_sales", SUM ( 'hcec_sales'[total_sales] )
    ),
    "Country Name", [cntry_code],
    "total sales", [total_sales]
)

SELECTCOLUMNS Function (DAX)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |
1 REPLY 1
Community Support Team
Community Support Team

Re: Summarizecolumns with rename of column

HI @xanhdieu,

 

I think SELECTCOLUMNS function will suitable for your requirement, it support to extract specific columns and rename them at same time.

New Table =
SELECTCOLUMNS (
    SUMMARIZECOLUMNS (
        OPTMZ_GRP[cntry_code],
        "total_sales", SUM ( 'hcec_sales'[total_sales] )
    ),
    "Country Name", [cntry_code],
    "total sales", [total_sales]
)

SELECTCOLUMNS Function (DAX)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |