Forum Discussion
Aggregate Patient Claims when Exceeding Threshold
- 4 years ago
Hi novotnajk
Here is my .pbix https://1drv.ms/u/s!AgCd7AyfqZtE3zw8aPY2ndPJl7a4?e=mmShevI believe that this solves both questions,
Thank you,
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel - 4 years ago
Hi Nathaniel!
We fixed all but one of the problems! 🙂 I'm going to repost the outstanding issue. Thanks for your help!
Try this:
Running Total =
var _currentDate = MAX('$ Medical Spend'[Reporting Date])
var _calc = CALCULATE([Medical Spend],FILTER(ALL('$ Medical Spend'[Reporting Date]),'$ Medical Spend'[Reporting Date] <=_currentDate))
return _calc
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
- Nathaniel_C4 years ago
Community Champion
Here is a pic of the table. And you don't need to use CALCULATE() in your first measure
Medical Spend = SUM('$ Medical Spend'[ $ Medical Spend])
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel- Nathaniel_C4 years ago
Community Champion
Hi novotnajk ,
The issue is that in your query, you use the MAX() date. You need to capture the date on the row that is currently being evaluated before you use the CALCULATE() and refer to it in your FILTER.Hopes this helps,
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel- novotnajk4 years ago
Resolver I
Hi Nathaniel, see the screenshot. For some reason all of the spend starts in January, but that isn't the case in the raw data.
- novotnajk4 years ago
Resolver I
Hi Nathaniel,
Thanks for the advice. I created the measure below:
$ Cumulative Medical Spend =var _currentDate = MAX('Medical'[reporting_date])var _calc = CALCULATE([$ Medical Spend],FILTER(ALL('Medical'[reporting_date]),'Medical'[reporting_date] <=_currentDate))return _calcBut it didn't show all of the claims based on the ISL slicer. Also, the Medical Spend measure has the calculate in front because the data change each month. Does that matter?I also can't get the $ SL Medical Spend formula do cumulate based on the filtered value either. I created a sample PBIX, but not sure how to attach it here.- Nathaniel_C4 years ago
Community Champion
Hi novotnajk ,
Save your pbix to your one drive, create a link, copy it, and then using the link symbol, here in the interface, paste it.- novotnajk4 years ago
Resolver I
Here's the sample..
- Nathaniel_C4 years ago
Community Champion
Hi novotnajk , if I understand your question, no it does not matter, try it and see.
Nathaniel