Skip to main content
cancel
Showing results for 
Search instead 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

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

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

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors