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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

@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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors