Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hello All,
I am new to DAX and am stuck. I don't quite understand the FILTER() function which is, I think, the reason I am stuck.
I have two tables, Dates & Forecast, which are joined on a field labeled Date. Dates table is a series of days from 1/1/2019 thru 12/31/2050. Forecast table is a series of Project Titles, Dates, Revenues & Earnings, there are 75 projects with multiple rows containing dates and numbers, enough to fill up 23k rows. For simplicity I'm only looking at the first project.
I finally was able to create a running total using quick measures and now have exactly what I want except that the running total continues running trough the end of the Dates table (12/31/2050) date when it should stop at 12/31/2019 (the last month for the project 452).
This first image shows the earliest date for my project 452 - begins with 6/1/2019.
The next image shows the last date for the same project 452 - ends on 12/31/2019. The next row
In my report I see the running total doing exactly what I want/need it to do thru 12/2019, however, it doesn't stop.
I would like for the running total to stop with the last month for that project then the next project appear in the list and see its Revenue and running total... rinse and repeat.
For reference, below is the formula for the running total, as produced by the quick measure:
I really appreciate any and all help!
Solved! Go to Solution.
@NeilL -
You could modify the calculation like the following:
Running Total = var maxForecastDateInContext = MAX(Forecast[Date]) var lastDateInContext = MAX('Date'[Date]) var lastRelevantDate = MIN(lastDateInContext, maxSalesDate) return CALCULATE( SUM('Forecast'[Revenue]), 'Date'[Date] <= lastRelevantDate )
Hope this Helps,
Nathan
@NeilL -
You could modify the calculation like the following:
Running Total = var maxForecastDateInContext = MAX(Forecast[Date]) var lastDateInContext = MAX('Date'[Date]) var lastRelevantDate = MIN(lastDateInContext, maxSalesDate) return CALCULATE( SUM('Forecast'[Revenue]), 'Date'[Date] <= lastRelevantDate )
Hope this Helps,
Nathan
@Anonymous That solved my problem! Thank you for the speedy reply and helping me solve my issue!
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
88 | |
85 | |
82 | |
65 | |
49 |
User | Count |
---|---|
137 | |
111 | |
101 | |
66 | |
65 |