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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
v-cgao-msft
Community Support
Community Support

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
v-cgao-msft
Community Support
Community Support

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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