Showing results for 
Search instead for 
Did you mean: 
Helper III
Helper III

How to calculate a % of stores that have two different codes

Hi PBI Community...TIA !!


I have a report (TEST A) that gives me a list of restaurants and two different deviations. (x and y). I'm trying to do the calculation for when a restaurant has both. When I run this code, the result is too high. Any ideas?


% of restaurants with glove AND mask deviation = DIVIDE(CALCULATE(count('TEST A'[Store ID]),'TEST A'[Code] = "x") + CALCULATE(count('TEST A'[Store ID]),
'TEST A'[Code] = "y"),count('TEST B'[Store ID]))
Super User I
Super User I

Hi @bcbuckley13 


Try this % of restaurants with glove AND mask deviation =
CALCULATE(count('TEST A'[Store ID]),'TEST A'[Code] = "x"||'TEST A'[Code] = "y"),
count('TEST B'[Store ID]))


In the Test A table do you have duplicate enteries?Do you want to count duplicate or disctinct? Please adjust above dax accordingly. Please let me know if this works.

Helpful resources

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Urdu Hindi D365 Bootcamp 768x460.png

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors