Forum Discussion
aashton
Helper V
2 years agoFilter measure based on clicking visual
I have a Contracts table that includes Index, Date, Source, etc. I have a measure to count IDs:
Total Contracts = CALCULATE(DISTINCTCOUNTNOBLANK('Contracts Signed'[Index]))
I have a bar graph visual, displayed by Source, the % of the grand total of Contracts. For example, Source Referral has total 123 contracts, out of a total of 743, for a total of 16.55% (see below).
I have a visual next to this that displays total contracts by Month-Year. When the user clicks on a month in this visual, it should filter the % of total Contracts visual to dispaly the % by month. For example, for June, there are a total of 8 contracts for Referrals, out of 75, should display 10.66%. However, my calculation is dividing the 8 by the total number of contracts (the 743), not just the 75 for that month. I am using this measure:
Total Contracts % Grand Total = [Total Contracts]/CALCULATE([Total Contracts], ALLEXCEPT('Contracts Signed', 'Contracts Signed'[Month Year]))
Is there a way to get this measure to work if they pick the Month-Year from another visual?
2 Replies
- amitchandak
Super User
aashton , Are you creating a meausre like
divide(DISTINCTCOUNTNOBLANK('Contracts Signed'[Index]), calculate(DISTINCTCOUNTNOBLANK('Contracts Signed'[Index]), allselected()) )
- aashton
Helper V
amitchandak I tried this...but the bar graph by source is filtered to only display certain sources. So using the AllSelected only gives me the total of all the sources I filtered on, and not the total from all sources overall.