cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

DAX for condition on a measure

Hi All,

 

I have a measure on which I want to check that how many person have scores more than 70%. Measure values in a table format look like as shown below.

Deepak190%
Dinesh240%
Suresh378%
Irfan467%

 

I want count 2 as answer in another measure, but my calculation is not producing correct result. Kindly help

pc_card = SUMX(Scores,IF(CALCULATE([pc_sum], 'Scores'[pc_id])>0.7 =FALSE(),0,1))

 

2 ACCEPTED SOLUTIONS
Super User IV
Super User IV

@Minakshi , Assume name is the first column , try


countx(filter(summarize(Scores,Scores[Name], "_1",[pc_sum]),[_1] >.7),[Name])

or

SUMX(values(Scores[Name]),IF(CALCULATE([pc_sum], 'Scores'[pc_id])>0.7,1,0))

 

in case you need less than use <



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Resolver III
Resolver III

@Minakshi ,

 

Both of them are measures.. not calculated columns...

 

Percent = DIVIDE( sum(StudentMarks[Marks]),500,0)
for count
Above70 = CALCULATE( COUNT(StudentMarks[Name]), FILTER(StudentMarks, [Percent]>0.7))
 
Note: if this gives you the solution, pls hit like button and mark as complete..
 
Thanks,
Mohammed Adnan

View solution in original post

3 REPLIES 3
Resolver III
Resolver III

@Minakshi ,

 

Both of them are measures.. not calculated columns...

 

Percent = DIVIDE( sum(StudentMarks[Marks]),500,0)
for count
Above70 = CALCULATE( COUNT(StudentMarks[Name]), FILTER(StudentMarks, [Percent]>0.7))
 
Note: if this gives you the solution, pls hit like button and mark as complete..
 
Thanks,
Mohammed Adnan

View solution in original post

Super User IV
Super User IV

@Minakshi , Assume name is the first column , try


countx(filter(summarize(Scores,Scores[Name], "_1",[pc_sum]),[_1] >.7),[Name])

or

SUMX(values(Scores[Name]),IF(CALCULATE([pc_sum], 'Scores'[pc_id])>0.7,1,0))

 

in case you need less than use <



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Super User II
Super User II

Is your % calculation a calculated column or a measure?

/ J


Connect on LinkedIn

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors