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
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
Super User
Super User

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
Super User
Super User

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
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
Top Kudoed Authors