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 August 31st. Request your voucher.

Reply
murphm6
Helper II
Helper II

If column (type decimal number) is blank then replace with text (Calculated Column)

Hi all,

 

Has anyone ever ran into this before? I have a calculated column that rounds to the nearest whole number and i want to create a new column which basically says if there are any blank rows then replace the blank with "No MOQ Listed". When I try to do this, i get an error that i can't use variant data types. If i change the number column to text - it no longer rounds the number to the nearest whole number

 

When I use a measure and try and add this to my matrix visual, it doesn't load and PowerBI runs out of memory.. any solutions?

 

1 ACCEPTED SOLUTION
Sahir_Maharaj
Super User
Super User

Hello @murphm6,

 

1. To address the issue of rounding and replacing blank rows with "No MOQ Listed" in a calculated column, you can use a combination of IF and ISBLANK functions.

NewColumn =
IF (
    ISBLANK ( Table[NumberColumn] ),
    "No MOQ Listed",
    ROUND ( Table[NumberColumn], 0 )
)

 

2. If changing the number column to text prevents the rounding functionality, you can try converting the rounded number to text explicitly within the formula.

NewColumn =
IF (
    ISBLANK ( Table[NumberColumn] ),
    "No MOQ Listed",
    FORMAT ( ROUND ( Table[NumberColumn], 0 ), "0" )
)

 

If your measure is causing Power BI to run out of memory, you can consider optimizing it. Aggregating large volumes of data or performing complex calculations in measures can consume significant memory resources. Consider filtering the data in your measure to reduce the volume of data being processed.
Evaluate whether you can pre-calculate and store some values in a calculated column instead of using a measure.

 

Should you require further details or assistance please do not hesitate to reach out to me.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

View solution in original post

1 REPLY 1
Sahir_Maharaj
Super User
Super User

Hello @murphm6,

 

1. To address the issue of rounding and replacing blank rows with "No MOQ Listed" in a calculated column, you can use a combination of IF and ISBLANK functions.

NewColumn =
IF (
    ISBLANK ( Table[NumberColumn] ),
    "No MOQ Listed",
    ROUND ( Table[NumberColumn], 0 )
)

 

2. If changing the number column to text prevents the rounding functionality, you can try converting the rounded number to text explicitly within the formula.

NewColumn =
IF (
    ISBLANK ( Table[NumberColumn] ),
    "No MOQ Listed",
    FORMAT ( ROUND ( Table[NumberColumn], 0 ), "0" )
)

 

If your measure is causing Power BI to run out of memory, you can consider optimizing it. Aggregating large volumes of data or performing complex calculations in measures can consume significant memory resources. Consider filtering the data in your measure to reduce the volume of data being processed.
Evaluate whether you can pre-calculate and store some values in a calculated column instead of using a measure.

 

Should you require further details or assistance please do not hesitate to reach out to me.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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