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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
wongmeta
Regular Visitor

Calculate response rate by use 2 slicers

Hi,

I have 2 files loaded to Power BI, one for result and another one for target then I would like to calculate the % response rate (count result/count target).  I selected card to show response rate, it's works when filter by country but when filter department the result was wrong.  Please advise any solution or idea to fix this.  Thanks

Noted : Country & department are many to many

 

wongmeta_2-1645780732662.png

wongmeta_3-1645780820728.png

 

wongmeta_1-1645780570491.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @wongmeta ,

 

The field in the middle table should be applied to the filter, not the field from the original table.

vcgaomsft_0-1646209090925.png

Please check. Also, attach the pbix file for reference.

 

Best Regards,
Community Support Team_Gao


If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi @wongmeta ,

 

Please create two middle tables first.

 

Table 3 = VALUES('Table 1'[Country])
Table 4 = VALUES('Table 2'[Department])

 

Create new relationships between tables and apply columns to filters.

vcgaomsft_0-1646038979144.png

Please check if the result is correct.vcgaomsft_2-1646038684884.png

vcgaomsft_1-1646039172195.png

Attach the pbix file for reference. Hope it helps.

 

Best Regards,
Community Support Team_Gao


If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

@Anonymous  Thanks for your advice.

I follow your instruction but still not working.  Seem response rate when filtered country or department are divided by total target not specific to country or dept target that I selected.  What's my mistake?

Below is my data model.

wongmeta_1-1646192743305.png

And 3 measures
test result = COUNTROWS('Survey result')
test target = COUNTROWS('SEA Target')
Test response rate = DIVIDE([test result],[test target])
 
Thank you very much!
Anonymous
Not applicable

Hi @wongmeta ,

 

Are there any unnoticed filters affecting the results? Consider using the ALLSELECTED expression to clear inner filters and keep outer filters. For example.

 

TOTAL RESPONSE = CALCULATE(COUNTROWS('Table 1'),ALLSELECTED('Table 3'),ALLSELECTED('Table 4'))
TOTAL TARGET = CALCULATE(COUNTROWS('Table 2'),ALLSELECTED('Table 3'),ALLSELECTED('Table 4'))
RESPONS RATE = DIVIDE([TOTAL RESPONSE],[TOTAL TARGET])

 

If this doesn't work for you, please consider sharing more details about it. And it would be great if there was a sample file without any sensitive information here.

 

Also, attach the pbix file for reference.

 

Best Regards,
Community Support Team_Gao


If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

@Anonymous  Hi

 

I've only 2 slicers in report and try to clean everything but still doesn't work.

Link to document file.

https://www.dropbox.com/s/pz2r8nrcobjg7mh/Sample%20data.pbix?dl=0 

 

Appreciated your helps.  Thank you very much!

Anonymous
Not applicable

Hi @wongmeta ,

 

The field in the middle table should be applied to the filter, not the field from the original table.

vcgaomsft_0-1646209090925.png

Please check. Also, attach the pbix file for reference.

 

Best Regards,
Community Support Team_Gao


If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

amitchandak
Super User
Super User

@wongmeta ,
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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 

Response rate is depends on country and department.

below table for result

CountryDepartmentCompanyQ1Q2Q3Q4
IDMAbBbCcDd4443
IDMAbBbCcDd4444
IDLAbBbCcDd4444
IDPAbBbCcDd4454
IDPAbBbCcDd4554
SGPAbBbCcDd5555
SGCAbBbCcDd4455
SGLAbBbCcDd4434
SGPAbBbCcDd3324
SGCAbBbCcDd4444
SGPAbBbCcDd4444

 

And table for target

CountryDepartmentCustomer IDHCustomer name
SGMxxxxAbCDE
SGMxxxxAbCDE
SGLxxxxAbCDE
SGPxxxxAbCDE
SGOxxxxAbCDE
SGCxxxxAbCDE
SGCxxxxAbCDE
SGMxxxxAbCDE
IDMxxxxAbCDE
IDLxxxxAbCDE
IDLxxxxAbCDE
IDCxxxxAbCDE
IDPxxxxAbCDE
IDMxxxxAbCDE
IDLxxxxAbCDE
IDPxxxxAbCDE

 

I created new measure to countrows of 2 tables and then use 

RESPONS RATE = DIVIDE('Survey result'[TOTAL RESPONSE],[TOTAL TARGET]) 
Results is works when filter country but missing when select department. 
 
wongmeta_0-1645784764417.png

 

Appreciated your advices

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors