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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
jagbatth
Regular Visitor

Sum or count of a measure - unable to sum a Measure or do a count of a measure

Hello,

I need some help calculating the sum a measure I created using DAX.

I caclulated the Thershold measure = 1-error rate

Error Rate measure = SUM of 'TABLE'[Errors] / Count 'TABLE'[STATE]

lastly for the Threshold > 97% measure = if([Threshold]>.97, 1, 0)

To give me the below Matrix view, 

Now when I try to creat a Measure that SUMS up the "1"s in the [Threshold > 97%] measure, I am not allowed?

SUM of states greater than 97% threshold = SUM([Threshold > 97%])

It wont let me input the Measure I created, I can only see it in the visual above but can not use it to show other metrics.

I tried creating a column instead and then it gives a CYCLIC REFERENCE error.

I get the same thing when trying to COUNT([Threshold > 97%]), as I need to figure out the % Met Threshold which would be:

SUM([Threshold > 97%]) / COUNT([Threshold > 97%])

jagbatth_0-1704340458559.png

Any help is mych appreciated!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @jagbatth 

 

You can try the following steps:

 

You create several measures as follow.

Error Rate = DIVIDE(SELECTEDVALUE('Table'[Errors]), SELECTEDVALUE('Table'[Claim Count]))
Thershold = 1 - [Error Rate]
Threshold > 97% = IF( [Thershold] > 0.97, 1, 0)
count1 = COUNTX( FILTER( 'Table', [Threshold > 97%] = 1), [Threshold > 97%])
percent = [count1] / COUNT('Table'[Product])

 

vxuxinyimsft_1-1704851250124.png

Is this the result you expect?

 

Best Regards,
Community Support Team _Yuliax

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @jagbatth 

 

You can try the following steps:

 

You create several measures as follow.

Error Rate = DIVIDE(SELECTEDVALUE('Table'[Errors]), SELECTEDVALUE('Table'[Claim Count]))
Thershold = 1 - [Error Rate]
Threshold > 97% = IF( [Thershold] > 0.97, 1, 0)
count1 = COUNTX( FILTER( 'Table', [Threshold > 97%] = 1), [Threshold > 97%])
percent = [count1] / COUNT('Table'[Product])

 

vxuxinyimsft_1-1704851250124.png

Is this the result you expect?

 

Best Regards,
Community Support Team _Yuliax

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ritaf1983
Super User
Super User

Hi @jagbatth 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

 

SystemProductStateClaim CountError RateErrorsThresholdX>97% Threshold
SAMPLEMarketFL13986.01%8494.00%0
SAMPLEMarketMO12005.75%6994.30%0
SAMPLECAREOH11717.69%9092.30%0
SAMPLECARESC10480.38%499.60%1
SAMPLEMarketGA135611.06%15088.90%0
SAMPLEMarketNC10724.01%4396.00%0
SAMPLEMarketTX12976.78%8893.20%0
SAMPLEMarketMI11211.07%1298.90%1
SAMPLEMarketMS12066.30%7693.70%0
SAMPLEMarketIN11282.84%3297.20%1
SAMPLEMarketAR12455.30%6694.70%0
SAMPLECAREAZ10720.28%399.70%1
SAMPLECARECA12490.72%999.30%1
SAMPLEMarketOH11366.95%7993.00%0
SAMPLECAREOK10730.19%299.80%1
SAMPLEMarketTN12386.06%7593.90%0
SAMPLEMarketKS10821.76%1998.20%1
SAMPLEMarketAZ11302.04%2398.00%1
SAMPLECAREWI10875.52%6094.50%0
SAMPLEMarketSC11671.29%1598.70%1
SAMPLEMarketIL10472.48%2697.50%1
SAMPLECARENE11150.72%899.30%1
SAMPLECAREOR10911.01%1199.00%1
SAMPLECAREPA11100.36%499.60%1
SAMPLEMarketKY11190.89%1099.10%1
SAMPLEMarketNE11661.11%1398.90%1
SAMPLECARENV10460.67%799.30%1
SAMPLEMarketPA10781.95%2198.10%1
SAMPLEMarketNV10811.02%1199.00%1
SAMPLEMarketWA11590.43%599.60%1
SAMPLECAREMO10900.18%299.80%1
SAMPLECAREKS11160.36%499.60%1
SAMPLECAREIN10701.59%1798.40%1
SAMPLECARETX10300.58%699.40%1
SAMPLECARENM10680.09%199.90%1
SAMPLECAREGA5740.17%199.80%1
SAMPLECAREMS10680.09%199.90%1
SAMPLECAREFL6160.16%199.80%1
SAMPLECAREAR11080.18%299.80%1
SAMPLECAREIL10.00%0100.00%1
        
      SUM:29
      Count:40
      sum/count:73%
      For SAMPLE SYSTEM73% met the Thershold

 

How Do I get the SUM and Count using DAX, above is a excel where it is easy to do, my final goal is to get to that 73% met the threshold but in PBI, I cannot sum or count that measure to be able to evetually divde and get a percentage.

 

Hi,

Try these measures

Measure = countrows(Data)

Measure 1 = calculate([Measure],data[Threshold]>0.97)

Measure 3 = divide([Measure 1],[Measure])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors