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
osmagar26
New Member

Use information from one filter inside another filter

Hi everyone, i need help with something that might be simple but im struggling a bit.

 

I need to be able to use the information from one filter in Power BI and then add that info another result.

 

Let me show you in a better way:

Table 1:

 

IDPeopleSex
3215845Female
3365944Male
3489843Organization

 

Table 2:

 

OrganizationMaleFemale
348984826

 

I have this data... where each row has an unique ID but as you can see there is female, male, organization. I need to know how to add just male and female info and the organization info distributed into male or female in a DAX function.

 

I tried this Power BI dax function but is not working =
VAR organization_male = CALCULATE(_nvaluemale, Sex(sex)="Organization")

VAR organization_female = CALCULATE(_nvaluefemale, Sex(sex)="Organization")

 

And then i made a selectedvalue or hasonefilter function depending on the selection in the slicer as this:

 

IF(HASONEFILTER(Sex(sex),
SWITCH(VALUES(Sex(sex),

"Female", organization_female

"Male", organization_male)

 

However is it not working since it is getting invalid due to i filter previously above where i used sex(sex)="Organization". It just showed me a blank card.

 

I just need to know how to distribute the organization members into male and female and have just those 2 options(male, female) without showing the organization option list. 

 

I hope this was clear.

 

Could you please help me on this??

1 ACCEPTED SOLUTION
v-rongtiep-msft
Community Support
Community Support

Hi @osmagar26 ,

What is your desired output? When you select "Female", what will appear in table 2? 

Organization   Female
34898   26

Like the above? 

 

When you select "Male", what will appear in table 2? 

Organization Male  
34898 48  

Also like the above?

 

I have created a simple sample, please refer to it.
Create a measure.

Measure = var _selected=SELECTEDVALUE('Table'[Sex])
return
IF(_selected=MAX('Table (2)'[Attribute])||MAX('Table (2)'[Attribute])="Organization",1,0)

Then filter the measure is 1.

vpollymsft_0-1670896612073.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-rongtiep-msft
Community Support
Community Support

Hi @osmagar26 ,

What is your desired output? When you select "Female", what will appear in table 2? 

Organization   Female
34898   26

Like the above? 

 

When you select "Male", what will appear in table 2? 

Organization Male  
34898 48  

Also like the above?

 

I have created a simple sample, please refer to it.
Create a measure.

Measure = var _selected=SELECTEDVALUE('Table'[Sex])
return
IF(_selected=MAX('Table (2)'[Attribute])||MAX('Table (2)'[Attribute])="Organization",1,0)

Then filter the measure is 1.

vpollymsft_0-1670896612073.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.