March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
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:
ID | People | Sex |
32158 | 45 | Female |
33659 | 44 | Male |
34898 | 43 | Organization |
Table 2:
Organization | Male | Female |
34898 | 48 | 26 |
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??
Solved! Go to Solution.
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.
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.
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.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
165 | |
116 | |
63 | |
57 | |
50 |