Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi there.
I've built a measure that calculate the YTD of another measure.
I'm using the Datetable as reference and seems to work.
YTD_%DescScrap_TOTScrapkg = TOTALYTD([%DescScrap_TOTScrap_kg], DateTable[date], YEAR((DateTable[date])))
and I didn't use any filter.
My problem is that I don't know how to check if the end_year (which I need to set as this year), calculate as in formula, is this year.
The Datetable which I use is a standard Datetable where "date" is a field formatted as "gg/mm/yyyy", but it contains dates from 2025 so I can't use the MAX() function.
I tried using YEAR(Today()) but with ont success.
Any suggestion? Please let m,e know if you need some more details or info.
Thanks.
Solved! Go to Solution.
I get the answer by myself.
Suppose to have a filter in all the pages of my report where I set year >=2021.
As I suspected, that measure gives me the YTD value from 01/01/2021 to today.
I need a measure that gives me the YTD value starting from 01/01/actualyear to today.
If I put a column like that, probably i'll have a column with more than this year (2023;2024;2025). I thought about it but maybe I didn't think enought :P.
U give me a good idea to check the result, thankyou.
You should have a column in your date table that has the year. If you place this next to the YTD measure ina table, it will show you the year.
ok I tried but i don't understand why if I put the year field in the table it works:
and if I don't put it the value is empty:
There is no context for the measure to display a value. The function is Year to date total, so unless you tell what year or what Year plus Quarter or Year plus Quarter plus Month, there is no way for it to calculate a Year to Date value.
it should, because i'd like to put the end_year (in this case, 2024 but i need something to say it dynamically every year) directly in the DAX formula.
It seems that the measure actually just calculate the total YTD from all the years I have in my filters and not just for the actual year.
My goal is to calculate the YTD 2024 also if my PBI visual filters says that Year>= 2022
Take this as example: no filters on the years, i don't undertand if my formula starts from 01/01/2021 or at the 1st january for each year. So, the 2023 value of 5.1% is calculated between 0101/2021-31/12/2023 or 01/01/2023-31/12/2023?
I get the answer by myself.
Suppose to have a filter in all the pages of my report where I set year >=2021.
As I suspected, that measure gives me the YTD value from 01/01/2021 to today.
I need a measure that gives me the YTD value starting from 01/01/actualyear to today.
User | Count |
---|---|
99 | |
87 | |
81 | |
76 | |
71 |
User | Count |
---|---|
112 | |
105 | |
96 | |
74 | |
66 |