Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
aashton
Helper V
Helper V

Filter 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). 
 
aashton_0-1697486589477.png

 

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 2
amitchandak
Super User
Super User

@aashton , Are you creating a meausre like

 

divide(DISTINCTCOUNTNOBLANK('Contracts Signed'[Index]), calculate(DISTINCTCOUNTNOBLANK('Contracts Signed'[Index]), allselected()) )

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@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.

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.