cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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.

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

Hi @SophRow ,

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

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!

Resolver II

Thanks Nathaniel!

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

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

6 REPLIES 6
Super User

Hi @SophRow ,

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

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!

Resolver II

Thanks Nathaniel!

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

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

Resolver II

Ignore - it's working now!

Super User

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!

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!

Super User

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

Proud to be a Super User!

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors