Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |