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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Calculated Column Not Working

khizerdaar_0-1686207688321.png

I have a calculated column named [Sales Amount Total] which is the SUM of two value columns [Presales] and [Vans].

 

I then created a new calculated column named [Binary] that converts any non zero value from [Sales Amount Total] to 1, else it shows 0.

Now I want to do a formula that takes the SUM of [Binary] and divides it by the COUNT of [Binary] but it won't let me do that.

The DAX syntax that seems logically correct to me to write is CALCULATE ( SUM [Binary] / COUNT [Binary] ). But it doesn't work and I'm not sure why.

I basically want a calculated column that shows percentage. So if 10 out of 20 stores had a sale, it will show me 10/20 or 50% in the grand total.

 

1 REPLY 1
Adescrit
Impactful Individual
Impactful Individual

Hi @Anonymous 

 

The following DIVIDE function should return the percentage calculation you're looking for:

DIVIDE( SUM( Table[Binary]) , COUNT( Table[Binary] ) )


Note I've made a couple of extra change to the formula here, besides changing CALCULATE to DIVIDE:

  1. Added the table name before [Binary]. Provided you have created a calculated column and not a measure you will need to add the table and column name in this format: Table[Binary]
  2. Added brackets (parentheses) around the column name, so SUM( Table[Binary] ) and COUNT( [Binary] )

If this doesn't work, double-check that you have created a column rather than a measure. If it is a measure you have created, you can't COUNT or SUM a measure, you would need instead to create two separate measures that calculate the SUM and COUNT of the required column.

 


Did I answer your question? Mark my post as a solution!
My LinkedIn

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.