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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
HCS
Frequent Visitor

data table in query editor

Hi,

 

I would like to create a Dates column or table which I can use as the shared axis for line and bar chart using two different sets dates columns for the line and bar values. I have tried using the formulas on the forum such as the below:

 

Date =
ADDCOLUMNS (
CALENDAR (DATE(2000,1,1), DATE(2025,12,31)),
"DateAsInteger", FORMAT ( [Date], "YYYYMMDD" ),
"Year", YEAR ( [Date] ),
"Monthnumber", FORMAT ( [Date], "MM" ),
"YearMonthnumber", FORMAT ( [Date], "YYYY/MM" ),
"YearMonthShort", FORMAT ( [Date], "YYYY/mmm" ),
"MonthNameShort", FORMAT ( [Date], "mmm" ),
"MonthNameLong", FORMAT ( [Date], "mmmm" ),
"DayOfWeekNumber", WEEKDAY ( [Date] ),
"DayOfWeek", FORMAT ( [Date], "dddd" ),
"DayOfWeekShort", FORMAT ( [Date], "ddd" ),
"Quarter", "Q" & FORMAT ( [Date], "Q" ),
"YearQuarter", FORMAT ( [Date], "YYYY" ) & "/Q" & FORMAT ( [Date], "Q" )
)

 

And I keep getting errors. One of them being An error occurred in the ‘’ query. Expression.Error: The name 'Date' wasn't recognized.  Make sure it's spelled correctly.

 

Does anyone know how I can overcome this problem and have a standard dates column I can use for an axis? 

 

Thanks,

Hannah

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @HCS,

 

You should create a data table in Power BI Desktop instead of Edit Query. The formula above is the dax expression which should be used in Power BI Desktop. By my test, the formula is correct.

 

You could follow the steps in the picture below to create the Date table. Then you could use the date as the shared axis for line and bar chart.

 

Untitled3.png

 

In addition, if you need a simple date table, you could create the data table with the formula below.

 

 

CALENDAR (DATE(2000,1,1), DATE(2025,12,31)),

 

You also could refer to this article to learn how to create a date table with CALENDAR.

 

 

Hope it can help you!

 

Best Regards,

Cherry

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

Hi Cherry, 

 

Thanks very much for your help. 

 

The dates table has been created which is great. However, as it is a different table from my core data there is no relationship between them and I am having difficulty creating one as there is no common column. Is there a way I can create a simple dates column in my original table and core data?

 

Thanks,

Hannah

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors