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 people,
So I have to calculate the accumulated revenue for 2021 and I have a bar chart with the months at the x axis.
I am using Calculate( sum (Table[revenue]), DatesYTD(Calendar[YearMonth].[Date])
I am using a Date hierarchy at the month level. I dont understand why it makes a different using .[Date] or not at the end of DatesYTD. With, I get the desired result an accumulated revenue, If I dont use .Date it only gives me the revenue for the particular month (no cumulative) which does not make sense to me, because the "Table" with revenues has always the first day of the month(.Date returns the full calendar)
Thanks
Thanks
Solved! Go to Solution.
Hi and many thanks for your help. I have already solved this without the YTD. Still I just used the .date because without it would give me each month revenue (not the cumulative). Although I do not understand why...
Hi @campelliann
Thanks for reaching out to us.
Please try this measure
-
usually, we don't need to use .[Date] in dax, it only work in date hierarchy row context.
Kindly refer to https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-auto-date-time
I also create a sample for your reference,
test1 = Calculate(SUM('Table'[revenue]), DatesYTD('Table'[Date]))
test2 = Calculate(SUM('Table'[revenue]), DatesYTD('Table'[Date].[Date]))
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
I recommend never using the .[Date] suffix (or other similar ones) at all. They tend to cause confusion.
I would write it like this:
CALCULATE ( SUM ( Table[revenue] ), DATESYTD ( Calendar[Date] ) )
Hi and many thanks for your help. I have already solved this without the YTD. Still I just used the .date because without it would give me each month revenue (not the cumulative). Although I do not understand why...
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 |
---|---|
110 | |
97 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |