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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
teatree
Frequent Visitor

Short Dates - Missing Data

Hi,

 

I have a list of short dates where day/months weren't recorded before May 2016.

 

e.g. 

 

2012

2013

2014

2015

2016

05/05/2016

08/08/2016

..etc

 

I'm unable to change the data type, so these values are just text. 

 

I would like to get a summary of 2016 as a whole compared to 2014, but then also be able to drill down into 2016. I know that I did this previously but I'm not sure how. I think I used a measure? 

 

Any help would be appreciated!

 

Thank you,

 

Francesca

 

 

1 ACCEPTED SOLUTION

Hi @teatree,

 

As you retrieve data from SQL Server database, it depends on which type you closed to connect. If you connect to SQL Server database in Import mode, then you can create a calculated column then change data type to Date mentioned by @ankitpatira. And create a column chart, place this calculated column in Axis property, drill down feature is enabled. See:

 

q1.PNGq2.PNGq3.PNG

 

If you connect to SQL Server in DirectQuery mode, after you create a calculated column then change data type to Date, and place it in Axis property, it will not generate date hierarchy. We need to create columns about year, month and day separately, then place those columns in Axis property. See:

 

q7.PNGq8.PNGq4.PNGq5.PNGq6.PNG

 

 

If you have any question, please feel free to ask.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
ankitpatira
Community Champion
Community Champion

@teatree You can create calculated column using DAX as below to get 01/01 appended to rows where date is missing and then convert type of that column to date.

 

= IF( LEN(TABLE(column)) = 4, "01/01/" & TABLE(column), TABLE(column) )

@ankitpatira thank you for your response.

 

I'm using power bi desktop connected to a SQL server so am unable to convert the type. Am I doing something wrong?

Hi @teatree,

 

As you retrieve data from SQL Server database, it depends on which type you closed to connect. If you connect to SQL Server database in Import mode, then you can create a calculated column then change data type to Date mentioned by @ankitpatira. And create a column chart, place this calculated column in Axis property, drill down feature is enabled. See:

 

q1.PNGq2.PNGq3.PNG

 

If you connect to SQL Server in DirectQuery mode, after you create a calculated column then change data type to Date, and place it in Axis property, it will not generate date hierarchy. We need to create columns about year, month and day separately, then place those columns in Axis property. See:

 

q7.PNGq8.PNGq4.PNGq5.PNGq6.PNG

 

 

If you have any question, please feel free to ask.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hi @v-qiuyu-msft

 

thank you for your help. 

 

my problem is when you said "in directquery mode, after you create a calculated column then changed data type to date"

 

this doesn't seem to work in direct query. i get this message:

1.JPG

 

 

Hi @teatree,

 

In my example, I added a calculated column in report not in Query Editor. Please go through my post again and try in your environment.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@teatree you should do that once data from sql server is imported into power bi desktop and do that via modellig tab.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.