cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Community Champion
Community Champion

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])
Regards,
Zubair


View solution in original post

2 REPLIES 2
Community Champion
Community Champion

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])
Regards,
Zubair


View solution in original post

Worked like a charm. Thank you. 

Helpful resources

Announcements
secondImage

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

secondImage

Power BI Women

Join our monthly meetings and learning sessions.

secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors