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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Date formating

Hello

 

I have data table with Date column in format "20200831" <- today.
I created a Date hierarchy table but I need to add a measure so it would show the date in the same way as in my Date column in data table so I could make a relationship between them. 

2 ACCEPTED SOLUTIONS
FarhanAhmed
Community Champion
Community Champion

you can create a column in date table and join it with your data table.

 

DtKey = FORMAT('Table'[Dt],"YYYYMMDD")

 

 







Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!




View solution in original post

lkalawski
Super User
Super User

Hi @Anonymous ,

 

You need to add calculated column: 

Date Formatted = Format('Table (2)'[Date], "YYYYMMDD")

lkalawski_0-1598867268387.png



_______________
If I helped, please accept the solution and give kudos! 😀

 

 

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , you can create this format in date using

 

Day key = format([Date],"YYYYMMDD")

Day key = year([Date])*10000 + month([Date])*100 +day([Date])

 

Or you can create date from this format

 

date = date(left([Day key],4) , mid([Day key],5,2), right([Day key],2))

 

 

 

20200831

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
lkalawski
Super User
Super User

Hi @Anonymous ,

 

You need to add calculated column: 

Date Formatted = Format('Table (2)'[Date], "YYYYMMDD")

lkalawski_0-1598867268387.png



_______________
If I helped, please accept the solution and give kudos! 😀

 

 

FarhanAhmed
Community Champion
Community Champion

you can create a column in date table and join it with your data table.

 

DtKey = FORMAT('Table'[Dt],"YYYYMMDD")

 

 







Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.