Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Sushant__08
Regular Visitor

To add a new column in power BI and combine data from two columns

Dear All,

 

I am new to Power BI and currently working on schedule control sheet preparation. We have a start and end dates for multiple categories. And I want to add a new column locating earliest and latest dates for each category. Then, combine start and end dates with "~" to show in the schedule chart.

 

Could you please help ?

 

Sushant__08_0-1721282275762.png

For instance,

 

In the above excel table, For tag number B11-PR-001, I want to display in 3rd column like (1-Jan-25 ~ 15-Jan-25).

 

My intention is to display (1-Jan-25 ~ 15-Jan-25) in power BI visual instead of only earliest / latest date as indicated.

Sushant__08_1-1721282440962.png

 

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@Sushant__08 , You can create a new calculated column by going to Data modelling and select new column using below mentioned DAX

 

CombinedDateRange =
VAR EarliestDate = CALCULATE(MIN(Table[Start Date]), ALLEXCEPT(Table, Table[Category]))
VAR LatestDate = CALCULATE(MAX(Table[End Date]), ALLEXCEPT(Table, Table[Category]))
RETURN FORMAT(EarliestDate, "dd-mmm-yy") & " ~ " & FORMAT(LatestDate, "dd-mmm-yy")




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

3 REPLIES 3
bhanu_gautam
Super User
Super User

@Sushant__08 , You can create a new calculated column by going to Data modelling and select new column using below mentioned DAX

 

CombinedDateRange =
VAR EarliestDate = CALCULATE(MIN(Table[Start Date]), ALLEXCEPT(Table, Table[Category]))
VAR LatestDate = CALCULATE(MAX(Table[End Date]), ALLEXCEPT(Table, Table[Category]))
RETURN FORMAT(EarliestDate, "dd-mmm-yy") & " ~ " & FORMAT(LatestDate, "dd-mmm-yy")




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Thank you sir. It worked perfectly.

Sushant__08_0-1721284910685.png

 

You are welcome




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors