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
raymondxie
Helper II
Helper II

Filter with calculated measures

I have a table on a database which contains a field Validated of varchar.

 

I need to count the number of records with [Validated] == 'Y', I created a measure with the following formula:

Validated = CALCULATE ( Count (Result[ID]), FILTER ( Result, [Validated] == 'Y') ) 

 

I got this error message:

 

Screenshot - 28_10_2016 , 10_07_39 AM.png

 

Can anyone tell me what am I missing here and how to fix it?

 

Thank you very much.

2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

Validated = CALCULATE ( Count (Result[ID]), FILTER ( Result, [Validated] = "Y") ) 

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

View solution in original post

I changed from creating column to creating measure and it works now, thank you very much. @Greg_Deckler

View solution in original post

5 REPLIES 5
Greg_Deckler
Super User
Super User

Validated = CALCULATE ( Count (Result[ID]), FILTER ( Result, [Validated] = "Y") ) 

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

Thank you @Greg_Deckler,

 

I got the following number which doesn't seem to be a count result but rather a sum result:

 

Screenshot - 28_10_2016 , 11_17_38 AM.png

The count should be something less than 50000

I changed from creating column to creating measure and it works now, thank you very much. @Greg_Deckler

Ah, I was wondering, because you said "measure" in your first post so I was thinking that couldn't be the issue!!


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

@Greg_Deckler

sorry about that, I just started learning PowerBI.

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.