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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
OlegV
Helper III
Helper III

Convert from sql to dax

Hi,

In SQL server there are two strings in the where clause:

'" "' (single double space double single)

'""' (single double double single)

 

Select ...

From ...

Where ColumnA <> '" "' and ColumnA <> '""'

 

How can I recreate where statement in DAX?

 

 

 

1 ACCEPTED SOLUTION
AmiraBedh
Super User
Super User

Here's how you can recreate your SQL WHERE clause in DAX:

FILTER (
TableName,
NOT (ColumnA = ' " ' ) && NOT (ColumnA = '""')
)

Or, if you are creating a measure or a calculated column, you might use an expression like this:

MeasureName = CALCULATE (
[YourCalculation],
FILTER (
TableName,
NOT (ColumnA = ' " ' ) && NOT (ColumnA = '""')
)
)

Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

View solution in original post

4 REPLIES 4
AmiraBedh
Super User
Super User

Here's how you can recreate your SQL WHERE clause in DAX:

FILTER (
TableName,
NOT (ColumnA = ' " ' ) && NOT (ColumnA = '""')
)

Or, if you are creating a measure or a calculated column, you might use an expression like this:

MeasureName = CALCULATE (
[YourCalculation],
FILTER (
TableName,
NOT (ColumnA = ' " ' ) && NOT (ColumnA = '""')
)
)

Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696
ftgpdx
Frequent Visitor

Assuming this is for a new measure within the report, I've generally solved this with a CALCULATE and double & for the AND. You could do something like: 

 

 

CALCULATE(
    SUM( 'Table'[Column] ),
    (NOT( 'Table'[Column A] = " ")  &&  NOT( 'Table'[Column A] = "")  )
)

 

 

Thank you for your reply.

 

Do you think that sql server string '" "' becomes " " in DAX.

And '""' becomes "" in DAX?

Check my answer 🙂


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors