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.
Greetings.
I am doing a month to month accumulation of direct costs but when I change the year the costs are reset.
Example of what I require:
What actually happens:
This is the function I am using:
CumulativeCost = CALCULATE(
SUM(Table[CostID]),
FILTER(
ALLSELECTED(Table[Month]),
ISONORAFTER('Table[Month, MAX('Table[Month), DESC)
)
)
I appreciate your help.
Solved! Go to Solution.
Hi,
Create a Calendar Table and build a relationship (Many to One and Single) from the Date column appearing in the base data table to the Date column in the Calendar Table. In the Calendar Table, write calculated column formulas to extract Year, Month name and Month number. Sort the Month name column by the Month number. To your visual, drag Year and Month name from the Calendar Table. Write these measures:
Cost = sum(Table[CostID])
Cumulative cost = calculate([Cost],datesbetween(calendar[date],minx(all(calendar),calendar[date]),max(calendar[date])))
Hope this helps.
Hi,
Create a Calendar Table and build a relationship (Many to One and Single) from the Date column appearing in the base data table to the Date column in the Calendar Table. In the Calendar Table, write calculated column formulas to extract Year, Month name and Month number. Sort the Month name column by the Month number. To your visual, drag Year and Month name from the Calendar Table. Write these measures:
Cost = sum(Table[CostID])
Cumulative cost = calculate([Cost],datesbetween(calendar[date],minx(all(calendar),calendar[date]),max(calendar[date])))
Hope this helps.
That's a job for your calendar table. In that table the [Month] column has to be of the format yyyyMM (ie it has to include the parent as well, in this case the year).
However If you use the calendar table as your base table (dimension) and join it to your fact table via the date column then you can use all the built-in DAX time intelligence functions, including all the TOTAL*TD functions. That is the preferred approach.
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |