Forum Discussion
Summing based on a date parameter in Power BI Report Builder
I have a report in Power BI Report Builder. I created a matrix with a date parameter. My totals in my matrix are not correct, I cannot get the total field to acknowledge the date range of the parameter. See Below.
Example- first row should show a total of 70 not 2730. It appears it is not considering the date parameter and is giving all the hours for an employee regards to the date parameter. This is the expression I am trying to use for this total column:
=Sum(IIF(Fields!WorkDate.Value >= Parameters!ID_StartDate.Value AND Fields!WorkDate.Value <=Parameters!ID_EndDate.Value,Fields!WorkHours.Value,0))
Any help would be greatly appreciated!
1 Reply
- Greg_Deckler
Community Champion
This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907