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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Zakaria_1980
Post Patron
Post Patron

Get blank() as output

Hi,

 

I've DB with Target for each module and how many achieved per City. so when I want to get the gap for each Module and per city, if in the DB in one of the cities, one of the modules was not forecasted to be done, i get blank() as output. how can i change that to N/A please?

 

 

Thanks

 

 

Zakaria_1980_0-1639158794171.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Zakaria_1980 ,

 

It looks like a matrix. But you chose a card visual, which is puzzling.

vstephenmsft_1-1639559260013.png

 

You can use the matrix visual to show the same effect.

vstephenmsft_6-1639559686897.png

 

 

 

Here's the solution.

1.Does your data model only have one table?

If it is, use dax to create a Module table.

Table 2 = DISTINCT('Table'[Module])

vstephenmsft_2-1639559525826.png

 

2.Relationship is as follows.

vstephenmsft_3-1639559543902.png

 

3.Create two measures.

Target value = 
var _sum=SUM('Table'[Target])
return
IF(ISBLANK(_sum),"N/A",_sum)
Acieved value = 
var _sum=SUM('Table'[Achieved])
return
IF(ISBLANK(_sum),"N/A",_sum)

 

Then we get the results.

vstephenmsft_8-1639559708602.png

vstephenmsft_7-1639559697572.png

 

Check the attachment for more details.

 

 

Best Regards,

Stephen Tao

 

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

12 REPLIES 12
Anonymous
Not applicable

Hi @Zakaria_1980 ,

 

It looks like a matrix. But you chose a card visual, which is puzzling.

vstephenmsft_1-1639559260013.png

 

You can use the matrix visual to show the same effect.

vstephenmsft_6-1639559686897.png

 

 

 

Here's the solution.

1.Does your data model only have one table?

If it is, use dax to create a Module table.

Table 2 = DISTINCT('Table'[Module])

vstephenmsft_2-1639559525826.png

 

2.Relationship is as follows.

vstephenmsft_3-1639559543902.png

 

3.Create two measures.

Target value = 
var _sum=SUM('Table'[Target])
return
IF(ISBLANK(_sum),"N/A",_sum)
Acieved value = 
var _sum=SUM('Table'[Achieved])
return
IF(ISBLANK(_sum),"N/A",_sum)

 

Then we get the results.

vstephenmsft_8-1639559708602.png

vstephenmsft_7-1639559697572.png

 

Check the attachment for more details.

 

 

Best Regards,

Stephen Tao

 

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

Zakaria_1980
Post Patron
Post Patron

yes but it doesn't work, that's why i shared with you the DB how it looks like.

please have a look at it.

 

thx

 

HI @Zakaria_1980 ,

 

Just curious to know. what visual is this?

Pragati11_0-1639396226487.png

Is it a table/matrix visual? I am not able to replicate this at my end. When I try to bring element as follows on a report page in Power BI:

Pragati11_1-1639396303832.png

 Now when I start using slicer, I don't see any blanks at my end.

slicer.gif

So now my next question is. Have you got any relationships going on in Power BI with this table?

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

this is the output that i have

 

Zakaria_1980_0-1639404423732.png

 

HI @Zakaria_1980 ,

 

What measure are you moving in your card visual which is displaying BLANK() ?

Also do you have any relationships going on at your end with your table?

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

for relationships , i don't have it since i've just one Tbl.

that visual i shared with you displays blank() for one Module which is not forecatsed to be done in one city. i have one column if it's done any module =1 if not is 0, so i pick that column as data for me.

 

HI @Zakaria_1980 ,

 

Sorry I didn't understand the calculation that is giving you BLANK() here.

Can you please paste your formula for the calculation here please?

We just need to modify the calculation somehow to replace BLANK() with N/A.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Zakaria_1980_0-1639406059505.png

 

Hi @Zakaria_1980 ,

 

If you want to avoid BLANK(), then you will have to create a measure to handle this.

I am assuming:

  • you are moving SUM(Consolidated[Certification Applcable]) to your card visual with an additional filter on Module = "PMO Practicioner".
  • Both Certification Applcable and Module columns are in same table Consolidated

 

Write a measure something as below:

cardCalc = 
var calc = CALCULATE(
                     SUM(Consolidated[Certification Applcable]), 
                     Consolidated[Module] = "PMO Practicioner"
                    )
RETURN
SWITCH(
       TRUE(), 
       calc = BLANK(), "N/A", calc
      )

Just check the DAX once specially for any naming conventions and filter expression values.

Move this measure to your card visual. It should display "N/A" not BLANK() now.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Zakaria_1980
Post Patron
Post Patron

I simplified the DB as follow:

CityModuleTargetAchieved
City#1Module#1107
City#1Module#2105
City#1Module#3108
City#1Module#42016
City#1Module#54530
City#2Module#12620
City#2Module#220
City#2Module#387
City#2Module#53612

 

 

the output that I've is as follow.

if i select in the filter City#1, i've the following:

 

 Module#1Module#2Module#3Module#4Module#5
Target1010102045
Achieved7581630

 

and if i select the City#2, i've the following:

 

 Module#1Module#2Module#3Module#4Module#5
Target2628Blank()36
Achieved2007Blank()12

 

what i need is that replace that blank() by N/A, please if you could implement this in Power bi desktop and share it with me.

 

thx

 

Hi @Zakaria_1980 ,

 

Did you try my response that I posted on Friday?

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Pragati11
Super User
Super User

Hi @Zakaria_1980 ,

 

You haven't shared any sample data here, so you can create a calculated column using following DAX:

IF(ISBLANK(yourTable[Column]), "N/A", yourTable[Column])

Replace yourtable and Column with your table name and column name.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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