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
Minakshi
Resolver I
Resolver I

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
amitchandak
Super User
Super User

@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 <

View solution in original post

mohammedadnant
Impactful Individual
Impactful Individual

@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
Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!

Thanks & Regards,
Mohammed Adnan
Learn Power BI: https://www.youtube.com/c/taik18

View solution in original post

3 REPLIES 3
mohammedadnant
Impactful Individual
Impactful Individual

@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
Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!

Thanks & Regards,
Mohammed Adnan
Learn Power BI: https://www.youtube.com/c/taik18
amitchandak
Super User
Super User

@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 <

tex628
Community Champion
Community Champion

Is your % calculation a calculated column or a measure?

/ J


Connect on LinkedIn

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.