Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi, I have a column in direct query mode which is of type string. I cannot change the data type of the column.
The column has two values, either a number or null.
How can I create a DAX measure which checks the value and if its a number then retain the same,else if its a null then consider it as 0?
Solved! Go to Solution.
Hi @Anonymous ,
Try VALUE function. It converts a text string that represents a number to a number.
Measure = VALUE(MAX('Table_2'[num]))+0
I use DirectQuery to connect SQL Server.
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.
Hi @Anonymous ,
Try VALUE function. It converts a text string that represents a number to a number.
Measure = VALUE(MAX('Table_2'[num]))+0
I use DirectQuery to connect SQL Server.
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.
@Anonymous
Create a measure along the lines of:
Measure 1 = SUM(Table[column]) + 0
Proud to be a Super User!
Paul on Linkedin.
The column is of type Text/String so SUM wont work right
@Anonymous
Try:
Measure 1 = IF(ISBLANK(MAX(Table[Column])), 0, MAX(Table[Column]))
Proud to be a Super User!
Paul on Linkedin.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 98 | |
| 72 | |
| 50 | |
| 48 | |
| 42 |