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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Jayrx7
Frequent Visitor

Rounding down an address to the hundred block and IF statement

Hello,

 

I have an address column that I want to round down to the hundred block (EX: 11111 Washington Av to 11100 Washington Av, 123 Washington Av to 100 Washing Av, 1234 Washington Av to 1200 Washington Av and so on). I did some searching and found that the ROUND([field], -2) function works in this case.  

 

I splited the address column by space, and left with a column that mostly have the house numbers but some are texts because of intersection addresses. I tried to do an if statement to round the number to the hundred block if it is a number and return the text if it isn't but my DAX doesn't seem to be working. Its giving this an error message of "Expression that yield variant date-type cannot be used to define calculated columns"

 

Here is my attempt:

Rounded_Address = IF(ISNUMBER([LOCATION - Copy.1]),  ROUND([LOCATION - Copy.1], -2), [LOCATION - Copy.1])
 
Can anyone help with this query or let me know if there is a better approach to tackle this problem?
 
Thank you so much!
1 REPLY 1
rsbin
Super User
Super User

@Jayrx7 ,

The issue is that in Power BI, you cannot have text and numbers in the same column.  This is what is meant by "variant-data type"

If you format everything to a text, your non-numeric addresses will remain.  Your address blocks will just be formatted as text.

Hope you can make this work for you.  If not, please post a small sample of your actual data and we can try to work out an alternate solution.

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors