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
Jojo197
Frequent Visitor

"NA" converts to na in measure

I have a matrix visual, with a single measure determining the values shown below. I can't seem to reproduce the issue with a simplified example, but in the following code, when MainTable[SectionHeader] (at the bottom) is the string "NA", the string "na" gets displayed on the matrix instead. I think this is due to some new update on power bi, as it was working perfectly fine previously. I've been able to fix it by adding on " " onto the end of each value, but it isn't exactly an elegant solution, and I was hoping someone in the community might have a better explanation/solution for me.

 

Value = IF([Hide],BLANK(),IF(HASONEVALUE(DimCategories[Code]),
    SELECTEDVALUE(FactArchive[ValueFinal]),
    IF(CALCULATE(
        COUNTA(FactArchive[ValueFinal])=0,
        ALL(FactArchive),FactArchive[Code] in VALUES(DimCategories[Code]),
        DimHeaders[HeaderBU]=SELECTEDVALUE(DimHeaders[HeaderBU])
    ),BLANK(),SELECTEDVALUE('MainTable'[SectionHeader]))
))

 

1 REPLY 1
amitchandak
Super User
Super User

@Jojo197 , There is no NA used in the measure.

You can have a calculation like

 

Value = IF([Hide],BLANK(),IF(HASONEVALUE(DimCategories[Code]),
SELECTEDVALUE(FactArchive[ValueFinal]),
IF(CALCULATE(
COUNTA(FactArchive[ValueFinal])=0,
ALL(FactArchive),FactArchive[Code] in VALUES(DimCategories[Code]),
DimHeaders[HeaderBU]=SELECTEDVALUE(DimHeaders[HeaderBU])
),"NA",SELECTEDVALUE('MainTable'[SectionHeader]))
))

 

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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.