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
android1
Post Patron
Post Patron

Measure to identify text values who correspond to a value in another column

Hi,

 

I have a column Fullname which contains people whoe are either male or female. The male/female is listed as text values in another column called gender. I need to seperate all the males & females. Not sure if a measure is even the best way to do this.

6 REPLIES 6
Anonymous
Not applicable

Have you tried:

 

Measure =
CALCULATE ( [Your Measure Expression Here], TableName[Gender] = "Male" )

 

Not sure if you're trying to count the number of males or females, but Calculate will allow you to modify the filter context.

 

You may also want to put [Gender] on either a slicer or an axis of a graph.  That will separate the two genders.

 

Maybe post what your final expected result is?

 

Best,

 

~ Chris

Thanks Chris,

 

This is'nt working for me. I need all the names in column Fullname in  2 seperate columns, Male & Female. The names in Fullname have a coresponding value, male or female in column Gender. Thomas Yorke is identified as male in coumn Gender, Sarah Connor is Female.

Sean
Community Champion
Community Champion

@android1 Go to the Query Editor and follow the steps in the picture...

Conditional Columns.png

Hi Sean,

 

I have a LIVE CONNECTION TO THE db SO UNFORTUNATELY THIS WONT WORK.ERRORR.jpg

Sorry about the CAPS, didn't realise it was on.

@android1

 

Since you are using live connection, you can't do any modeling within Power BI Desktop, you have to do it in your data source. If it's also a tabular, you can add calculated columns like:

 

Male = IF(Table[Gender]="Male",Table[FullName],BLANK())

Female = IF(Table[Gender]="Female",Table[FullName],BLANK())

Regards,

 

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.