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
Anonymous
Not applicable

Count of or sum of to display 1 or 0

I have an issue.

 

I have a table which has the below columns

 

2019-12-26_15-12-46.png

What i am trying to do is to find out if the RJT# for a week# and a CMP and a PR is 1 so consider COUNT Measure as 1

 

COUNT measure should sum up and display final result (1+1+0+1 etc)

 

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi @Anonymous ,

 

What you need is to create a measure, which is shown as below:

 

 

Measure = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[RJT#]=1&&'Table'[PR]=1))

 

 

Then put the columns which you wanna group by and the measure into a table visual, then you will finally see as below:

333.png444.png

 

For the related .pbix file,pls turn to the URL below:https://microsoftapc-my.sharepoint.com/:u:/g/personal/v-kellya_microsoft_com/Ea8Vqojw_AVKgP2TluhYV80BuO3ibLPeNRqpsF2RA2f16w?e=tg7zMl

 

Hope this would help.

 

 

Best Regards,

Kelly

View solution in original post

4 REPLIES 4
v-kelly-msft
Community Support
Community Support

Hi @Anonymous ,

 

What you need is to create a measure, which is shown as below:

 

 

Measure = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[RJT#]=1&&'Table'[PR]=1))

 

 

Then put the columns which you wanna group by and the measure into a table visual, then you will finally see as below:

333.png444.png

 

For the related .pbix file,pls turn to the URL below:https://microsoftapc-my.sharepoint.com/:u:/g/personal/v-kellya_microsoft_com/Ea8Vqojw_AVKgP2TluhYV80BuO3ibLPeNRqpsF2RA2f16w?e=tg7zMl

 

Hope this would help.

 

 

Best Regards,

Kelly

Anonymous
Not applicable

I have followed the steps that you mentioned for #rejections and Payroll count both are measures.

 

I have used an if logic for a new measure called

1 prv pr = IF([#rejections]=1,1,0)
 
now, i wish to use sum/count of payroll count and 1 prv pr for throughput. so ideally for OLU 50, 52; payroll count should be 2 and 1 prv pr should be 1 and hence throughput should be 50% (1/2*100)

 

2019-12-27_3-49-32.png

Anonymous
Not applicable

@v-kelly-msft Thank you. just an add on question.

 

how can i calculate sum or count of measures?

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous ,

 

i think at first you have to SUMMARIZE your data

https://docs.microsoft.com/en-us/dax/summarize-function-dax

than iterate (SUMX) over the result and check your condition.

https://docs.microsoft.com/en-us/dax/sumx-function-dax

https://docs.microsoft.com/en-us/dax/if-function-dax

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


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