Forum Discussion
Slicer/Filter should not change the Measure calculation
- 6 years ago
Just a clarification: The table would maintain interaction. I was suggesting selecting the slicer, going to interaction, and disabling the table only. All other visuals and slicers would still work on the table. Just turning it off for the date slicer.
Does the following work for you?
New Percentage = VAR Numerator = CALCULATE( SUM('Time Tracker Data'[Hours]), ALLEXCEPT( 'Time Tracker Data', 'Time Tracker Data'[Name], 'Time Tracker Data'[LogDate], 'Time Tracker Data'[Productive/ Non-productive] ) ) VAR Denominator = CALCULATE( SUM('Time Tracker Data'[Hours]), REMOVEFILTERS('Time Tracker Data'[Name],'Time Tracker Data'[LogDate]) ) RETURN DIVIDE(Numerator,Denominator,0)Here, the denominator ignores the context filters on the Name field and the log date field.
If that isn't what you want, you can change what fields are in the REMOVEFILTERS() function. At this point it is really figuring out which filters you want to keep, and those filters are povided by the table rows Name and Productive/Non-Productive (controlled by a slicer) and the log date.
I'm not sure I've helped too much here. I tend to do the math in Excel or on a calculator to know what results I want then work on the filters to make sure I get the right results, then make sure the audience will understand it without me having to explain for 15min what the calculation is doing.
Just back from the Holidays,
Thanks for your time and also for the new functions.
I have done few changes in in the CALCULATE function to add, both (Numerator & Denominator)
'Time Tracker Data'[LogDate].Month,
'Time Tracker Data'[LogDate].Year,And changed the Slicer to slice on Month and Year.
This helped to have right values even when we change the Filters or Time Slicers.
Regards,
David
Great! Glad you were able to adapt my solution to your needs.