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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.