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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
BankJay
Regular Visitor

Need to countrows based on two variable characteristics

I have 3 categories of clients (Column 1), each starting with a different number.

 

I need to be able to calculate how many in each category are Blank in Column 2.

 

I have been able to filter to get totals of categories separately (filtering for 1st number), and to count the total Blanks for the entire table, but I cannot figure out how to create a measure that tells me Blank within each category.

 

Thank you!

6 REPLIES 6
v-yangliu-msft
Community Support
Community Support

Hi  @BankJay ,

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

It would be better if the expected results were shown in the form of pictures.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Here is an example. So here, I need to know how many blanks in "Name" for each ID category starting with a different number. For example, for "ID" starting with "5" how many blanks. For "ID" starting with "8" how many blanks. For "ID" starting with "9" how many blanks.

 

BankJay_0-1673980000190.png

 

v-yangliu-msft
Community Support
Community Support

Hi  @BankJay ,

I created some data:

vyangliumsft_0-1673487559187.png

Here are the steps you can follow:

1. Create calculated column.

Column =
COUNTX(
    FILTER(ALL('Table'),
    'Table'[Column1]=EARLIER('Table'[Column1])&&'Table'[Column2]=BLANK()),[Column1])

2. Result:

vyangliumsft_1-1673487559189.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Thank you, but I'm not sure if that quite gets to what I need. In your example (thank you for creating data!) I would need one additional step I think. I would need to calculate a measure for Category 123, Category 234, and Category 345 that just tells me the total blanks. 

 

Is there an easy way to combine that with what you have shown?

vicky_
Super User
Super User

Have you looked at the COUNTBLANK function? https://learn.microsoft.com/en-us/dax/countblank-function-dax

Thank you for this reply! That would work, but I'd have to find a way to form that function for each of my Categories, which all appear in Column 1. Any ideas?

Helpful resources

Announcements
Europe Fabric Conference

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.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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