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
NOVICE02
Helper III
Helper III

replace character with number

Brand new to Power BI here and I have searched to no avail...

 

Is it possible to replace a character with a number using DAX? I am selecting data for the model using direct query and one of the columns that i need to calculate sum of has the value "NULL". I have tried using the substitute function but realized that it only replaces a string with a string. I can't use the replace function in the transform tab because of direct query. Is there a way to do this or should i just ask the database admin to replace all "NULL" with 0 on his end?

 

Thank you

1 ACCEPTED SOLUTION
bharathvee
Frequent Visitor

Hi @NOVICE02,

 

If you just after summing the columns and ignoring NULL values, the PowerBI will automatically ignore the NULL values and sum up the total. See the attached image for the sample.

Sum total with null valuesSum total with null values

 

If this is not what you are after, copy a sample of your data and share it here.

View solution in original post

2 REPLIES 2
bharathvee
Frequent Visitor

Hi @NOVICE02,

 

If you just after summing the columns and ignoring NULL values, the PowerBI will automatically ignore the NULL values and sum up the total. See the attached image for the sample.

Sum total with null valuesSum total with null values

 

If this is not what you are after, copy a sample of your data and share it here.

You are correct. I was looking at the data wrong. Thank you

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.