cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
agd50
Resolver I
Resolver I

DAX Help - Count row category type

agd50_0-1689639713083.png


I feel this should be simple, what am I missing here? Count any that has the value of 'True'

 

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @agd50  you should use "calculate" to give a filter context.
If your due column's data type is boolean the right formula :

test = CALCULATE(COUNT('Table'[cat]),'Table'[due]=TRUE())
Ritaf1983_0-1689642943705.png

in the case it is a string :

test text = CALCULATE(count('Table'[cat]), 'Table'[due string]= "True")
Ritaf1983_1-1689643107507.png

Link to a sample file 

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



View solution in original post

3 REPLIES 3
Ritaf1983
Super User
Super User

Hi @agd50  you should use "calculate" to give a filter context.
If your due column's data type is boolean the right formula :

test = CALCULATE(COUNT('Table'[cat]),'Table'[due]=TRUE())
Ritaf1983_0-1689642943705.png

in the case it is a string :

test text = CALCULATE(count('Table'[cat]), 'Table'[due string]= "True")
Ritaf1983_1-1689643107507.png

Link to a sample file 

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



Wonderful job, well done!

Glad to help 🙂

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors