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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Anonymous
Not applicable

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
Anonymous
Not applicable

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.