cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
CS Regular Visitor
Regular Visitor

Rename Column in Table Created with UNION and SUMMARIZECOLUMNS

I am creating a table in Power BI with the following formula:

 

SlicerDates = 
UNION( 
   SUMMARIZECOLUMNS(
      Dates[End of Month],
      "Time Period", "Month"
   ),
   SUMMARIZECOLUMNS(
      Dates[End of Quarter],
      "Time Period", "Quarter"
   )
)

The unioned table has the right data, but the column with the dates is named "End of Month." Is there a way to rename this column in this formula? I looked at SELECTCOLUMNS but could not find a way to reference the table column created with the UNION statement.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Rename Column in Table Created with UNION and SUMMARIZECOLUMNS

Hi @CS

 

try this

 

SlicerDates = VAR mytable=
UNION( 
   SUMMARIZECOLUMNS(
      Dates[End of Month],
      "Time Period", "Month"
   ),
   SUMMARIZECOLUMNS(
      Dates[End of Quarter],
      "Time Period", "Quarter"
   )
)
RETURN
SELECTCOLUMNS(mytable,"End of Period",[End of Month],"Time Period",[Time Period])
2 REPLIES 2
Super User
Super User

Re: Rename Column in Table Created with UNION and SUMMARIZECOLUMNS

Hi @CS

 

try this

 

SlicerDates = VAR mytable=
UNION( 
   SUMMARIZECOLUMNS(
      Dates[End of Month],
      "Time Period", "Month"
   ),
   SUMMARIZECOLUMNS(
      Dates[End of Quarter],
      "Time Period", "Quarter"
   )
)
RETURN
SELECTCOLUMNS(mytable,"End of Period",[End of Month],"Time Period",[Time Period])
CS Regular Visitor
Regular Visitor

Re: Rename Column in Table Created with UNION and SUMMARIZECOLUMNS

Worked like a charm. Thank you.