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

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

Reply
mfminor
Helper I
Helper I

Help preventing filtering on table visualization

I have a measure want to use to divide the count of specific partnumbers vs the total number of specific units processed for the reporting period. To get the percentage I created the following measure

 

PN_Used Count vs Formula Count = FORMAT(DIVIDE(AviationTable[PN_Used Count], aviationtable[Formula Count],"no result"), "percent")

This should work in theory. The problem comes into play when I put all the information I want presented into a table. 

 

calcgonewrong.png

 

The measure no long looks at all of the specific unit, but the number that have the specific PN_Used. What I want to do is almost matrix like (I tried to use a matrix with the same result). I would like to see a Unit Description followed by the total count of units processed (formula count), then each PN_Used for each Unit with the total number of that specific part number was used. Then I want a percentage calculated by taking the ([PN_Used Count]) that is specific to the [PN_Used] divided by total count of unit description ([Formula Count]). If that makes any sense. 

1 ACCEPTED SOLUTION
v-sihou-msft
Microsoft Employee
Microsoft Employee

@mfminor

 

In your scenario, your total count of units processed (formula count) is associcated with each Unit Description, and the ([PN_Used Count]) is associated with each [PN_Used], you shoud have two counts group on different column, the measure should be like:

 

PN_Used Count vs Formula Count = 
CALCULATE(AviationTable[PN_Used Count],ALLEXCEPT(AviationTable,AviationTable [PN_Used]))
/ 
CALCULATE(aviationtable[Formula Count],ALLEXCEPT(AviationTable,AviationTable[Unit Description]))

Regards,

 

View solution in original post

4 REPLIES 4
v-sihou-msft
Microsoft Employee
Microsoft Employee

@mfminor

 

In your scenario, your total count of units processed (formula count) is associcated with each Unit Description, and the ([PN_Used Count]) is associated with each [PN_Used], you shoud have two counts group on different column, the measure should be like:

 

PN_Used Count vs Formula Count = 
CALCULATE(AviationTable[PN_Used Count],ALLEXCEPT(AviationTable,AviationTable [PN_Used]))
/ 
CALCULATE(aviationtable[Formula Count],ALLEXCEPT(AviationTable,AviationTable[Unit Description]))

Regards,

 

@v-sihou-msft,

 

You appear to have answered my question, but I now have a new "issue".  In my table it appears that I was able to get the percentages I was looking for but my PN-Used Count and Formula Count columns are still filtered. I tried using the measure below to see the full [formula count] unfiltered, but it then displays the total distinct count as shown. I want it to show me the count of distinct SN_Received "filtered" by what Unit Description it is instead. Again I am really new to DAX and Power BI so this is probably really easy.

 

Formula Count Unfiltered = CALCULATE(
	DISTINCTCOUNT(AviationTable[SN Received]),
	ALLEXCEPT(AviationTable,AviationTable[SN Received])
)

 

Below is how the table looks using this measure.

 

Countquestion.png

I hope I have enough information included. Again, what I would like to see is [Formula Count Unflitered] to actually be "filtered" by [Unit Description]. Or in your language for [Formula Count Unfiltered] to only be associated with [Unit Description]

Found my problem. Was a really big "DUH" moment. 

 

Formula Count Unfiltered = CALCULATE(
	DISTINCTCOUNT(AviationTable[SN Received]),
	ALLEXCEPT(AviationTable,AviationTable[Unit Description])
	
)

Solution to my problem

Greg_Deckler
Community Champion
Community Champion

Not entirely following what you are after, but it sounds like a problem that could be fixed with an ALLEXCEPT clause somewhere in your formula to remove certain column contexts from the calculation. In your case, it sounds like an ALLEXCEPT(PN_Used), so remove all context filters except PN_Used. So perhaps something like:

 

PN_Used Count vs. Formula Count = 
VAR myvar = FORMAT(DIVIDE(AviationTable[PN_Used Count], aviationtable[Formula Count],"no result"),"percent") RETURN CALCULATE(myvar,ALLEXCEPT(AviationTable[PN_Used]))

Again, not understanding exactly what you are after but something along these lines is probably the answer.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.