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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Alicia83B
Helper I
Helper I

Count Rows with Multiple Conditions

Hello, 

 

I have created a matrix that shows territory. sales person , opps stage, and countrow opps. On the sales person, I have checked off show items with no data, so I can see sales persons with no opps. I tried to copy the matrix and change to a pie chart, but the Blanks (no data) drops off the visual. 

 

How can I create a pie chart showing the same data? Below is a example set of data and the outcome I am looking to achieve in the pie chart. 

 

Territory     Name                CountRows Opp Stage

01Brad0 
01Chris1Open
01Edward3Won
02Tim4Open
02Tim1Won
02Will0 
02Brian0 
02Jim2Lost
03John3Open
03Tom1Won

 

Opp StageCount
Open8
Lost2
Won5
Blank3

 

 

Alicia83B_0-1664311837659.png

 

 

Thank you in advance for looking at my post. 

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @Alicia83B 

Here are the steps you can follow:

(1)This is my test data which is the same as yours:

vyueyunzhmsft_0-1664332369003.png

(2)We can create a measure :

Count = IF( SELECTEDVALUE(Sheet2[Opp Stage])=BLANK() , COUNTROWS('Sheet2') , SUM('Sheet2'[CountRows]))

(3)Then we put the measure in the visual and the field we need and we can meet your need:

vyueyunzhmsft_1-1664332443268.png

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

 

Best Regards,

Aniya Zhang

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

 

View solution in original post

3 REPLIES 3
v-yueyunzh-msft
Community Support
Community Support

Hi , @Alicia83B 

Here are the steps you can follow:

(1)This is my test data which is the same as yours:

vyueyunzhmsft_0-1664332369003.png

(2)We can create a measure :

Count = IF( SELECTEDVALUE(Sheet2[Opp Stage])=BLANK() , COUNTROWS('Sheet2') , SUM('Sheet2'[CountRows]))

(3)Then we put the measure in the visual and the field we need and we can meet your need:

vyueyunzhmsft_1-1664332443268.png

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

 

Best Regards,

Aniya Zhang

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

 

amitchandak
Super User
Super User

@Alicia83B , You should use Opp Stage ad legend and count of Territory as value.

 

If needed use this option on the right click of Opp Stage in the visualization pane

 

ShowItemwithoutdata.JPG

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak  This does work when I have the data in a matrix visual. However, if I switch to a pie chart visual, it does not work. That is what I am looking to do. Thx. 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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