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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
JayTG123
Advocate I
Advocate I

Replace Unique Text Values to Number 1

Hi all,

 

I am hoping someone can help with this. I have a list of unique text values (Linked Permit column) and just want to replace this with a 1 so it can become a SUM and as a total on a card visual. For everything that is blank I will replace this with a 0 but I would like to know how I can replace all of these unique values as a number 1 please.

Many thanks

Jay
Screenshot 2021-12-31 154815.jpg

 

1 ACCEPTED SOLUTION
aj1973
Community Champion
Community Champion

Hi @JayTG123 

In Power Query add an conditional column and use IF is equal Blank then return 0, else 1 

aj1973_0-1640966614839.png

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

View solution in original post

4 REPLIES 4
AlexisOlson
Super User
Super User

BTW, you don't need another column to calculate the sum of non-blank values.

 

An alternative would be to write a measure that counts the non-blank values.

CountNonblank = CALCULATE ( COUNT ( Table1[Linked Permit] ), Table1[Linked Permit] <> "" )
aj1973
Community Champion
Community Champion

Hi @JayTG123 

In Power Query add an conditional column and use IF is equal Blank then return 0, else 1 

aj1973_0-1640966614839.png

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

@aj1973 thank you so much!! You learn something every day!

Happy New Year to you ! 

Jay

aj1973
Community Champion
Community Champion

lol indeed, never stop learning 🙂

 

Happy new year to you as well

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

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.