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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Mughees
Helper II
Helper II

Filtering blank rows through power query before applying IF command

Hi All,

 

I am making a dashboard that has got calculations. My scenario is this:

 

I have created a data set that has got different indicators and it is being represented for different hierarchies. Below is the matrix that has KPI's for your reference.

POWERBI.png

 

One of the indicators NPAFP rate has different denominator in calculation for Division, District and Tehsil. That is why I plan to create three different columns for NPAFP (two are already there). NPAFP rate formula is below:

 

NPAFP rate District = if (AFP[m.YRONSET] <= VALUE("2018"),(COUNT(AFP[District]))/MAXX(AFP,AFP[Population target 2017-18])*100000*12/((month(today())-.5)),(COUNT(AFP[District]))/MAXX(AFP,AFP[Population Target 2018-19])*100000*12/((month(today())-.5)))
 
Due to difference in population, its formula get different for Division, district and Tehsil level. Since Division is the biggest and it contains districts and than districts contain Tehsils.
 
The issue I am facing is that my data base have some empty values for Tehsil, however, district and Division are always there. Hence, I want to add something in the above query that only takes rows of Tehsils that are filled. I cannot apply such filter through slicer. If apply it in slicer, many columns that have districts in their value get ommited. 
 
Kindly guide me so that I can get it fixed. 
 
Regards
1 ACCEPTED SOLUTION
Payeras_BI
Solution Sage
Solution Sage

Hi @Mughees ,

 

If your issue is with that COUNT in the numerator taking the blanks into account for the Tehsil measure, you could try this:

 

COUNT () - COUNTBLANK()

 

See below:

 

Sample Table:

 

Payeras_BI_0-1607194159975.png

 

Sample Matrix:

Payeras_BI_1-1607194219032.png

 

Regards,

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain

View solution in original post

2 REPLIES 2
Payeras_BI
Solution Sage
Solution Sage

Hi @Mughees ,

 

If your issue is with that COUNT in the numerator taking the blanks into account for the Tehsil measure, you could try this:

 

COUNT () - COUNTBLANK()

 

See below:

 

Sample Table:

 

Payeras_BI_0-1607194159975.png

 

Sample Matrix:

Payeras_BI_1-1607194219032.png

 

Regards,

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain

Thankyou. BTW i just applied counta and it resolved my issue preety quickly. thank you though

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors