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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
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.