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.
Hello,
I have a database of a the last year and Im looking to create a measure that shows the cummulative cost from month to month. For example.
I require a measure that can sum with some sort of cummulative filters. Like having a filter to calculate the cost up until may 2020, or calculate all the costs up until aug 2020 or dec 2020. I tried using a filter but was only showing individual months (for example was showing only the costs in september, and Im looking to see all the costs from january to september.
Thank you for your time.
Solved! Go to Solution.
Hi @Shackwell
Download sample PBIX file with the following code and visuals.
SumCost = SUM('DataTable'[Cost])
You can use a slicer for the dates, set to 'Between', so you get a slider that you can select dates with. The cost is then affected by the selected date range.
Regards
Phil
Proud to be a Super User!
Hi @Shackwell ,
First create a calendar table as slicer;
Then create a measure as below:
Measure =
var _dates=DATESYTD('calendar'[Date])
Return
IF(MAX('DataTable'[Date]) in _dates,SUM('DataTable'[Cost]),BLANK())
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!
Hi @Shackwell ,
First create a calendar table as slicer;
Then create a measure as below:
Measure =
var _dates=DATESYTD('calendar'[Date])
Return
IF(MAX('DataTable'[Date]) in _dates,SUM('DataTable'[Cost]),BLANK())
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!
Hi @Shackwell
Download sample PBIX file with the following code and visuals.
SumCost = SUM('DataTable'[Cost])
You can use a slicer for the dates, set to 'Between', so you get a slider that you can select dates with. The cost is then affected by the selected date range.
Regards
Phil
Proud to be a Super User!
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 |