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
Anonymous
Not applicable

create measure based on textcolumn

Hi all.

 

How do you in dax create a measure (not interested in creating a calculated column) based on a text column.

I have a table containing ColumnA so whenever ColumnA is blank then for that row I would like it to be marked with 1 and else 0 - something like this:

# ColumnA NewMeasure (NOT calculated column)

1 textABC     0

2                   1

3 textBCD     0 

***

IF(sumx(table,table[ColumnA) = " ",1,0) I know this is not working, but just to show my thoughts

So that I later on can sum on this NewMeasure, and I would not only show rows where NewMeasure = 1 but all rows.

 

Thanks in advance

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , check one of the two

 

sumx(table,if(table[ColumnA] = " ",1,0))

 

or

 

if(isblank(sum([ColumnA] )) ,1,0)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , check one of the two

 

sumx(table,if(table[ColumnA] = " ",1,0))

 

or

 

if(isblank(sum([ColumnA] )) ,1,0)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

thanks a lot 🙂 this worked:

 sumx(table,if(table[ColumnA] = " ",1,0)) BUT when asking if a string is blank it should be sumx(table,if(table[ColumnA] = "",1,0)) (without spaces between "" ) 

Thanks again

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.