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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Dim Date Error

Hey Guys, Newbie here.

 I am trying to calculate YTD Sales using the following Formula:

 

Sales YTD = TOTALYTD([Sales], DimDate[CalendarDate].[Date])

   

Sales exists in a fact table and DimDate is a Date dimension . The two are related by datekey.

However when I try to plot the visual for YTD Sales, I get the following error:

MdxScript(Model) (6, 39) Calculation error in measure 'FactQBTransaction'[Sales YTD]: An invalid numeric representation of a date value was encountered

 

I checked the date table but everything seems fine

 

Can anyone help me with this? 

 

2 REPLIES 2
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

Could you please tell me if your problem has been solved? 

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

Based on my test, it could work on my side, could you please offer me your data stucture or pbix if possible?

1.PNG

Also you can test with our sample report on your side.

https://www.dropbox.com/s/dc8ms0usflhrbch/Dim%20Date%20Error.pbix?dl=0

 

Regards,

Daniel He

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

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors
Top Kudoed Authors