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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Calculating Numerator from Denominator and getting Subtotals

Hello!  I have been racking my brain trying to get subtotals for each Agency that goes on 911 calls.

My expected output would be to show the % of the total for each company when the filter is clicked. It does it in the CARD but I want it in the Circle graphic too.  

CKNIGHT_0-1626273808625.png

 

The values are actually reports which I do distinct counts on.  The measures are by denominator and numerator and I did it both by each hospital report and by each agency.  My goal is to have a global filter where the user can see the counts by agency. 

 

For each hospital report I am doing this calc: 

% of Incidents where a Stroke Assessment was performed =
CALCULATE(DIVIDE(
    DISTINCTCOUNTNOBLANK('Stroke_Num'[PreHospital_Report_ID]),
    DISTINCTCOUNTNOBLANK('Stroke_Denominator'[PreHospital_Report_ID])
))
To compare agencies I am doing this:
Count of GMR_Agency divided by Count of GMR_Agency =
CALCULATE(DIVIDE(
    COUNTA('Stroke_Num'[GMR_Agency]),
    COUNTA('Stroke_Denominator'[GMR_Agency])
))
I know I am doing something wrong...I already tried the quick measure thing relating to the matrix like here: (is this the best way?)
CKNIGHT_1-1626205795313.png

 

CKNIGHT_0-1626204875453.png

 

4 REPLIES 4
edhans
Super User
Super User

You are going to have to provice some expected results and data for us to work with @Anonymous 

I don't see any errors. You may not be getting the results you want, but that is why we need data and expected results.

 

How to get good help fast. Help us help you.

How To Ask A Technical Question If you Really Want An Answer

How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Anonymous
Not applicable

@edhans - Thanks - I added in more details about Expected output.  It is a subtotaling issue for the most part.

We need data. Measures on cards often return different results than a chart because of the filter context. Unless acted on externally by the filter pane, cards have virtually no filter context, other than the model itself, or the DAX within the measure. Most other visuals though have multiple filters operating on them via the axis, legend, etc. So you will need to remove filters or limit your data to the latest time period or something. 

"Something" is what we need data on. Very VERY difficult to return a working measure for you with nothing but PNG files.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Anonymous
Not applicable

Yes I understand...I run SQL code to gather millions of PCR_ID's (prehospital repots) for over 400 911 agencies.  I then need to run a denominator of a safety measure then compare it to a numerator which is if the EMT did this and did that. Once I run the count I take the total # of PCR IDs and divide them by the # that met the safety measure: 

% of Safety_01 Measure not met =
calculate(DIVIDE(
    COUNTA('Safety_01_Num'[PreHospital_Report]),
    COUNTA('Safety_01_Denom'[PreHospital_Report])
)-100) (this shows the % that did not meet the measure.
What I need is to subtotal each Agency to show who is closer to meeting the measure : like this but in a DAX code to show in both a Card and a circle chart, etc.  Here is what the numers look like in a matrix: CKNIGHT_0-1626299077662.png

 

the first column is the numerator count and the 2nd the denominator count.  I hope this answers the more data question??  I am not very comfortable with numerator /denominator counts and subtotaling and have tried to apply subtotaling I used in standard finance and it does not work: PercentA = divide(CALCULATE(sum(Sheet1[Sales]),Sheet1[Item Type]="A"),SUM(Sheet1[Sales])) (like that sort of division does not work when the data are counts and I am trying to avoid adding extra CASE WHEN codes.

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.