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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bcbuckley13
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]))
 
 
1 REPLY 1
mhossain
Solution Sage
Solution Sage

Hi @bcbuckley13 

 

Try this % of restaurants with glove AND mask deviation =
DIVIDE(
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

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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