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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
SophRow
Resolver II
Resolver II

Create measure to count rows based on value in one column that is filtered by another column

Hi,

 

I want to create a measure that counts the number of rows in a table that contains a value from one column, that is filtered by values from another column.

 

SophRow_0-1673733823641.png

 

So, I'd like to know How many Event "A" there are that have Criteria of "A" or "C" - so in this example it would = 2. 

 

Thanks!

Soph

2 ACCEPTED SOLUTIONS
Nathaniel_C
Community Champion
Community Champion

Hi @SophRow ,

if [#"Criteria "] = "A" and [#"Type of Event"] = "A" or [#"Criteria "] = "C" and [#"Type of Event"] = "A" then 1 else 0

 

Nathaniel_C_0-1673735839649.png


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Thanks Nathaniel!

 

It's almost working - just this weird error with then and else:

 

SophRow_0-1673737272115.png

Any ideas? I added "#" before "Seriousness Criteria" but that throws up an "invalid identifier" error

View solution in original post

6 REPLIES 6
Nathaniel_C
Community Champion
Community Champion

Hi @SophRow ,

if [#"Criteria "] = "A" and [#"Type of Event"] = "A" or [#"Criteria "] = "C" and [#"Type of Event"] = "A" then 1 else 0

 

Nathaniel_C_0-1673735839649.png


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks Nathaniel!

 

It's almost working - just this weird error with then and else:

 

SophRow_0-1673737272115.png

Any ideas? I added "#" before "Seriousness Criteria" but that throws up an "invalid identifier" error

Ignore - it's working now!

Hi @SophRow ,
IF should be lower case. if





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




hi @SophRow ,

You can create a column in Power Query and then sum that column in a measure.

Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Nathaniel_C_1-1673736366776.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.