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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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()) )

Share with Power BI Enthusiasts: 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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors