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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
harshagraj
Post Partisan
Post Partisan

Calculate has been used in a TRUE/Faslse- Need count of project

Hi all i am getting an error when i am trying to get count of closed projects.
Defn of Closed projects is Projects >=100%

Column = CALCULATE(COUNT('report'[Project]),[Average Status]>=1)
[Average Status] is a measure and [Project] is a column.

I need to display total closed projects in a card visual.
3 REPLIES 3
amitchandak
Super User
Super User

@harshagraj , you can create a measure like

measure = CALCULATE(COUNT('report'[Project]),filter('report',[Average Status]>=1))

Greg_Deckler
Super User
Super User

Maybe [Average Status] has a CALCULATE in it?

 

Maybe try:

 

Column =

VAR __Table =

  ADDCOLUMNS(

    'report',

    "Average Status" = [Average Status]

  )

RETURN

  COUNTX(FILTER(__Table,[Average Status]>=1),[Project])

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
jdbuchanan71
Super User
Super User

@harshagraj 

You will need to use a FILTER to do the comapre to the the measure like so.

CALCULATE (
    COUNT ( 'report'[Project] ),
    FILTER ( VALUES ( 'report'[Project] ), [Average Status] >= 1 )
)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.