Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Will someone please convert this sql to dax for me?
case when nvl (STAFF_ABILITY_RESOLVE_ISSUES, 'N/A') = 'N/A' then null else to_number (STAFF_ABILITY_RESOLVE_ISSUES) end as atri,
I need to get the N/A values in the field to become nulls and at the same time convert the entire column to number format, specifically decimal if possible. I am in direct query mode in the query editor so it does not allow me to convert the column so I am hoping this statement will allow it!!
Thanks
Hi @Anonymous,
Please try this code.
=if [STAFF_ABILITY_RESOLVE_ISSUES]= "N/A" then null else Decimal.From([STAFF_ABILITY_RESOLVE_ISSUES])
Alternatively, you can directly choose Decimal Number under the data type list.
Best regards,
Yuliana Gu
HI @Anonymous
Please try this
Column = SWITCH( TRUE() , ISNUMBER('Table1'[STAFF_ABILITY_RESOLVE_ISSUES]), FIXED('Table1'[STAFF_ABILITY_RESOLVE_ISSUES],2), BLANK() )
@Phil_Seamark Expression.Error: The name 'SWITCH' wasn't recognized. Make sure it's spelled correctly.
Hi there,
Are you using Power BI and are you doing this in DAX or in the Query Editor?
@Phil_Seamark Hey Phil! I am using query editor in power BI desktop. Custom Column
all above solution were provided using DAX, if you are in query editor, on add customr column, you need to do following:
if STAFF_ABILITY_RESOLVE_ISSUES = "N/A" then null else STAFF_ABILITY_RESOLVE_ISSUES
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k Hello, Can you help me with a forumal that will convert the entire column in to a decimal number format in the same statement? The problem is that even if I I substiture the N/A for null, I need the entire column to be number... the direct query mode doesn't allow me to just simply convert it to decimal format...
I have tried using to_number and value but it didn't like those words:
if [AMENITIES] = "N/A" then null else to_number ([AMENITIES])
if [AMENITIES] = "N/A" then null else value ([AMENITIES])
Any ideas of a better word there that would be accepted?
Thank you in advance for your kind help!
Does this work for you?
IF( STAFF_ABILITY_RESOLVE_ISSUES = "N/A", BLANK(), VALUE(STAFF_ABILITY_RESOLVE_ISSUES) )
@vega Expression.Error: The name 'IF' wasn't recognized. Make sure it's spelled correctly.
Expression.Error: The name 'IF' wasn't recognized. Make sure it's spelled correctly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
71 | |
55 | |
38 | |
31 |
User | Count |
---|---|
71 | |
64 | |
62 | |
50 | |
46 |