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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mortensenpb
New Member

Need to use extracted MONTH from a date column along with two other columns to create a primary key

I am trying to create a primary key column from the following data set I am importing from a text file.

 

LocationProd_CDMonthQty
BLDV11029255692120.47
BLDV110302556915186.25
BLDV11036255693358.22
BLDV11043255691434.15
BLDV11127255691916.13

 

[Month] is a serial number corresponding to a date in 1970 but that is irrelevant to me so I have an import step that extracts just the month from from [Month] (the value is 8).

 

Capture.JPG

 

I want to use the combination of [Prod_CD], [Location], and Extract of [Month] to create a primary key.  I created a custom column with the following formula:

 

[Prod_CD]&[Location]&[Month]

 

This produces an error for the entire column.  The result I am looking to get is (for the first row) "12029BLDV8".

1 ACCEPTED SOLUTION

Adding another step transforming the extracted month into text fixed the issue.

View solution in original post

2 REPLIES 2
ankitpatira
Community Champion
Community Champion

@mortensenpb what error did you get when you created custom column ? make sure column is of type Text.

Adding another step transforming the extracted month into text fixed the issue.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors