Create percentage from two counts but also want to see "records details" after clicking on that


I have simple problem and tried many solution but not successful, I will explain from starting.

I have a table from which I took total count of raws as count_1 , another count_2 will be after applying some filter on the same table. Now I have to divide the both counts to get the percentage. This is view I need.

Solution I tried.

  1. As we can't not divide in same question , I will create two different questions and then join them and then using the formula "Sum([Question 135 → Count]) / Sum([Count]) * 100" . Here the problem is after clicking on numbers i couldn't see all records details.

  2. I have written native query in metabase by selecting all records and join them using
    select x.number / y.number
    query 1
    ) x
    query 2
    ) y on 1=1

here again , it says because of question written in sql, you can't drill through. I turned it into a model tried to drill through , now only numbers are showing no details still.

  1. Again joining two queries, but with all records. And tried to calculate percentage after convert it into model.
    select *
    query 1
    ) x
    query 2
    ) y on 1=1

But still not able to divide two counts here so that I can see all records.

PLease help and suggested a genuine solution.
FYI- I am using the latest version , attaching Diagnostic Info
"browser-info": {
"language": "en-GB",
"platform": "MacIntel",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36",
"vendor": "Google Inc."
"system-info": {
"file.encoding": "UTF-8",
"": "OpenJDK Runtime Environment",
"java.runtime.version": "",
"java.vendor": "Eclipse Adoptium",
"java.vendor.url": "",
"java.version": "",
"": "OpenJDK 64-Bit Server VM",
"java.vm.version": "",
"": "Linux",
"os.version": "5.4.0-1029-aws",
"user.language": "en",
"user.timezone": "GMT"
"metabase-info": {
"databases": [
"hosting-env": "unknown",
"application-database": "postgres",
"application-database-details": {
"database": {
"name": "PostgreSQL",
"version": "15.2 (Debian 15.2-1.pgdg110+1)"
"jdbc-driver": {
"name": "PostgreSQL JDBC Driver",
"version": "42.5.4"
"run-mode": "prod",
"version": {
"date": "2023-09-18",
"tag": "v0.47.2",
"branch": "release-x.47.x",
"hash": "536c24c"
"settings": {
"report-timezone": null


my 2 cents: build a view in the DB with the metrics you need, so you can then use gui queries on Metabase without having to do any SQL so you get all the bells and whistles from the product

Thanks for help Luiggi, Actually I can't the change the DB . What I have done i have prepared two GUI questions and join them. Taking all count of id, and distinct count of another id. Just want to divide them so that I got the percentage by Quarter. Is there any "div function" or any anything so that I can divide these two counts. I tried by custom expression but giving me this error.