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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.