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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
kjsullivan
Frequent Visitor

YTD Error: An invalid numeric representation of a date value was encountered

I am new to Power BI and I am trying to create a matrix for a report I am building, but keep running into trouble with my YTD. My code for the YTD is as follows: YTD Revenue = TOTALYTD(SUM(Test[Revenue]),'Sheet1'[Renewal Date]). My matrix has my Years in the columns section and Month Name is the rows section. I have two tables, one has all of my data, such as Renewal Date, Year, Index_ID, and Month Name while the other table has the Index_ID to create the relationship and Revenues. The relationship was able to be created, but whenever I go to insert the YTD Revenue into the matrix I get the error of "MdxScript(Model) (3,30) Calculation error in measure 'Sheet1'[YTD Revenue]: AN invalid numeric representation of a date value was encounted. I watched a video created by Power BI and copied wht he was doing, but still recieved this error.

2 REPLIES 2
v-caliao-msft
Microsoft Employee
Microsoft Employee

@kjsullivan,

 

You could create a calculated column like below.
Cumulative =
VAR RowDate = Table1[Date]
RETURN
    CALCULATE (
        SUM ( Table1[Recurring] );
        FILTER (
            Table1;
            Table1[Date] <= RowDate
                && YEAR ( Table1[Date] ) = YEAR ( RowDate )
        )
    )

 

Here is a similar issue for you reference
https://community.powerbi.com/t5/Desktop/DAX-Running-Total-YTD/td-p/21576

 

Regards,

Charlie Liao

@v-caliao-msft Thank you for the help, but I had it right the first time. What was messing me up were the NULL values in my data.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors