cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
CS
Frequent 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 III
Super User III

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])
Try my new Power BI game Cross the River

View solution in original post

2 REPLIES 2
Super User III
Super User III

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])
Try my new Power BI game Cross the River

View solution in original post

CS
Frequent Visitor

Re: Rename Column in Table Created with UNION and SUMMARIZECOLUMNS

Worked like a charm. Thank you. 

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Top Solution Authors
Top Kudoed Authors