Forum Discussion
Max Month formula does not work in tables
- 6 years ago
dapperscavenger 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
dapperscavenger 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
- dapperscavenger6 years ago
Helper V
Thanks Greg. Interesting reads and really helped explain why the totals in the table were different to the sum of the column. I'm definitely going to be keeping it in mind for the future.
I tried implementing the HASONEFILTER solution but it did the reverse of what I wanted. i.e. it made the total the correct sum of what was in the column, but what I actually wanted was for the total to stay at the lower figure and the column values to filter correctly.
To demonstrate, the incorrect formula gives me this:
Storage_Location UoM TM Location 1 958945.61 Location 4 919186.68 Location 5 9349 Location 3 1 Location 2 33 Location 6 3.92 Location 7 2 Location 8 3 Location 9 1.83 Total 958,979.61 When what I'm actually trying to do is get this:
Storage_Location UoM TM Location 1 958,945.61 Location 2 33.00 Location 3 1.00 Total 958,979.61 In the first table the total is correct for just the max month, but the values are from all the months. The second table is correctly filtered on just the max month.
To reword my question, then, how would one deal with a creating a chart or table when 2 x top N filters are required? The reason I made the filter on max month is that I have a table which I already have filtered on top N (10) products and cannot apply the top N month. As a workaround I have used relative time filtering (is in this month) BUT I am concerned that this will break at the beginning of each month. My data is updated in weekly snapshots throughout the month, so there will likely be a couple of days each month where I won't have the new month's data before the new month begins.
Prhaps it would be better to create a separate measure for the top ten products instead of a max month filter, and then use the powerbi's built in top N for my date?
Or maybe I can create a calculated column that identifies the max date, and filter on that.