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.
Hi All
My expression get error :-
_YTD_REV_ =
var _max = today()
return
calculate(TOTALYTD((GL[1_REV] = "REV"),'Date'[Date]),filter('Date','Date'[Date]<=_max))
Above link is my PBI file
Paul
Solved! Go to Solution.
Hi, @admin11
According to your DAX formula, I think that the true reason for this error is that you should use a measure or an expression as the first parameter of the TOTALYTD() function, you can try to use this measure:
_YTD_REV_ =
var _max = today()
return
calculate(TOTALYTD([AMOUNT],'Date'[Date]),GL[1_REV] = "REV",filter('Date','Date'[Date]<=_max))
Then you can get the same value as the first measure you created, like this:
You can download my test pbix file here
More info about TOTALYTD() function
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @admin11
According to your DAX formula, I think that the true reason for this error is that you should use a measure or an expression as the first parameter of the TOTALYTD() function, you can try to use this measure:
_YTD_REV_ =
var _max = today()
return
calculate(TOTALYTD([AMOUNT],'Date'[Date]),GL[1_REV] = "REV",filter('Date','Date'[Date]<=_max))
Then you can get the same value as the first measure you created, like this:
You can download my test pbix file here
More info about TOTALYTD() function
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@admin11 Do you have a measure you're trying to calculate as YTD?
There's no problem using the DATESYTD as you have, but you need only a MEASURE as the first input parameter/argument in TOTALYTD and you are using a boolean expression.
Try:
_YTD_REV_ =
TOTALYTD([Amount],'Date'[Date]),GL[1_REV] = "REV")
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Hi Allison
Thank you for sharing.
I get error msg , i try to use 'G:[] also cannot.
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 |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |