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
RilwanFlame
Helper III
Helper III

How to filter out blanks or NA

I have a DAX written : 
EOC_Sent = CALCULATE(COUNT('Sheet1'[SENTMONTH]), 'Sheet1'[SurveyTaken]=2)
but not getting the right value which is suppose to be 217 when i manually filter to check the dataset in Excel. But my R code is giving me the right value : Filter(!is.na(SentMonth), Surveytaken==2)

 

Hoping someone could help on how i can rewrite the DAX to exclude blanks or NA. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @RilwanFlame ,

 

I'm not sure what the data is in your table "sheet1", I created a simple for testing.

vcgaomsft_0-1649644193799.png

then new a calculated column.

EOC_Sent =
CALCULATE (
    COUNT ( 'Sheet1'[SentMonth] ),
    'Sheet1'[SurveyTaken] <> BLANK ()
        && 'Sheet1'[SurveyTaken] = 2
)

return result.

vcgaomsft_1-1649644549538.png

Attach the PBIX file for reference. Hope it helps.

 

If this doesn't work for you or I misunderstand your needs, please consider sharing more details about it. And it would be great if there was a sample file without any sensitive information here.

 

It makes it easier to give you a solution.

  1. Sample (dummy dataset) data as text, use the table tool in the editing bar.
  2. Expected output from sample data.
  3. Explanation in words of how to get from 1. to 2.

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @RilwanFlame ,

 

I'm not sure what the data is in your table "sheet1", I created a simple for testing.

vcgaomsft_0-1649644193799.png

then new a calculated column.

EOC_Sent =
CALCULATE (
    COUNT ( 'Sheet1'[SentMonth] ),
    'Sheet1'[SurveyTaken] <> BLANK ()
        && 'Sheet1'[SurveyTaken] = 2
)

return result.

vcgaomsft_1-1649644549538.png

Attach the PBIX file for reference. Hope it helps.

 

If this doesn't work for you or I misunderstand your needs, please consider sharing more details about it. And it would be great if there was a sample file without any sensitive information here.

 

It makes it easier to give you a solution.

  1. Sample (dummy dataset) data as text, use the table tool in the editing bar.
  2. Expected output from sample data.
  3. Explanation in words of how to get from 1. to 2.

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Thank you so much for your response. The DAX worked giving the correct value.

On trying to get the RR when the slicer for a particular month is selected, i get the more than a 100% which does not seem right.

Here is my DAX for the RR %: 

EOC_RR = CALCULATE(COUNT('Sheet1'[SurveyTaken]), 'Sheet1'[SurveyTaken]=2, 'Sheet1'[main_module_complete]=2) / CALCULATE(COUNT('Sheet1'[SentMonth]),'Sheet1'[SurveyTaken] <> Blank() && 'Sheet1'[SurveyTaken]=2)

Whitewater100
Solution Sage
Solution Sage

Hi:

What does your data look like? Do you want a measure or calculated column? Thanks

 

Calculate columns

Can you show what the data cloumns looks like in your Sheet1?

for example, if it is all in one table, you can paste it:

Whitewater100_0-1649272403841.png

 

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.