cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Microsoft
Microsoft

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

@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

Highlighted
Frequent Visitor

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

@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
May 2020 Community Highlights

May 2020 Community Highlights

It’s time for another PBI Community recap!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Top Solution Authors