DAX Measure help - how to total only items filtered

BoundedInANutshell

New Member
Joined
Nov 25, 2021
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have the following measure which is used to dynamically switch between counts and percentages (using a slicer). However, when it is displaying percentages and the matrix is filtered with other slicers, the percentage calculation still uses the overall total, not the reduced (filtered) total - thus the overall column doesn't total 100% I know I need to change the division part (which is wrapped in the FORMAT) but what do I change it to so that the percentage calculation uses the reduced (filtered) total ?

Any help would be greatly appreciated.
Many thanks, Jason
Rich (BB code):
PercentageViewToggle =
IF (
ISFILTERED ( 'SlicerDataViews'[View] ),
FORMAT( COUNT ( 'Enquiries'[RID] )
                / CALCULATE ( COUNT ( 'Enquiries'[RID] ), ALLEXCEPT ( 'Enquiries', 'Enquiries'[Enquiry Date] ) ),"0.0%"),
( COUNT ( 'Enquiries'[RID] )
))
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Try using allselected. This will allow the slicer to work, but percentages will show the total local to the internal visual
 
Upvote 0
Solution
Hi Matt, Yes, that has worked a treat. One strange anomaly though, is my matrix shows rows with no data when the ISFLTERED condition is true and it displays percentages. But not when ISFILTERED is false. Any thoughts how I could fix this? I've tried adding a visual filter for IS NOT BLANK but that doesn't work.
Any help greatly appreciated (and thanks for the ALLSELECTED fix !)
Regards . . . Jason
 
Upvote 0

Forum statistics

Threads
1,223,659
Messages
6,173,637
Members
452,525
Latest member
DPOLKADOT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top