cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Anonymous
Not applicable

Count how many times a sum measure returns blank

Hi,

 

I have this measure that returns the sum of hours spent on a project.

 

AC No. Hours = SUM('Hours Real'[QTY])

 

How do I create a measure that returns the number of projects that have a sum of hours spent that is returned as (blank)?

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

Hi @Anonymous ,

I have created a simple sample, please refer to it to see if it helps you.

Create a measure.

Measure = 
CALCULATE(COUNTROWS('Hours Real'),
          FILTER(ALL('Hours Real'),
                [AC No. Hours]=0||[AC No. Hours]=BLANK()))

vpollymsft_0-1669785759656.png

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

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

4 REPLIES 4
v-rongtiep-msft
Community Support
Community Support

Hi @Anonymous ,

I have created a simple sample, please refer to it to see if it helps you.

Create a measure.

Measure = 
CALCULATE(COUNTROWS('Hours Real'),
          FILTER(ALL('Hours Real'),
                [AC No. Hours]=0||[AC No. Hours]=BLANK()))

vpollymsft_0-1669785759656.png

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

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

Anonymous
Not applicable

Hi @v-rongtiep-msft,

 

Great, this seems to do the trick! Do you know if there is a way for the filter on the page to apply to this measure as well? For example if I want to filter on projects in the last 12 months or with a specific person responsible. 

Thank you in advance!

FreemanZ
Super User
Super User

try something like this,

0ProjectCount = 
COUNTROWS( 
    FILTER(
        VALUES('Hours Real'[Project]), 
        [AC No. Hours]=BLANK()
    )
)
Anonymous
Not applicable

Hi, 

 

Thank you for the help! It returns only one row, so it is not quite what I am looking for. The AC No. Hours measure sums the QTY so I can have the total QTY for each project ID.

Is there a way to count how many times the AC No. Hours measure returns blank or 0 because there are no QTY values for a given project ID?

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors