Showing results for 
Search instead for 
Did you mean: 
New Member

How to use IF(Selectedvalue)

HI Everyone. I'm learning how to use PowerBI desktop and I'm new to the forum. I hope everyone could help me with this.

I imported 2 excel files, each has 5 tables that are almost identical. They are pre and post conversion results in number of outstanding units.

I created measure of % of ownership for both set of data.

I linked these two set of data by employee Unique ID table. Using ID from this employee ID table, then select pre conversion or post conversion, it returned the correct number of outstanding units. However, the percentage returned 100% for all employees.


When I pull employee ID from pre conversion table, it gives me correct % of ownership for each employee, same as for post conversion.

Select Outstanding Units = IF(SELECTEDVALUE('Select Period'[Period])= "Pre Conversion", 'Select Period'[Pre-C Outstandings],'Select Period'[Post-C Outstandings])
Select % = IF(SELECTEDVALUE('Select Period'[Period]) = "Pre Conversion", [% Ownership Pre-C],[% Ownership Post-C])


How can I get the correlated % of ownership when select pre-conversion or post conversion by selecting the employee ID from the joined table? 


Your help is much appreciated.

New Member

Stakeholder IDNameOutstanding Units
1John Smith100
2Mary Smith 200
3Jones Brown300
4James Swenson400
Stakeholder IDNameOutstanding Units
1John Smith150
2Mary Smith 200
3Jones Brown300


So the first table with 4 stakeholders is the pre-conversion table, the second one with 3 stakeholders is the post conversion. I joined these 2 tables 1:1. 


I created measure to get % ownership for each stakeholder in each table: % Ownership Pre COnversion and % Ownership Post Conversion. 


I created a table as SELECTED PERIOD with only 1 colum and 2 rows for selection of Pre Conversion, Post Conversion, in order to use the IF(SELECTEDVALUE) 


I added slicer to the page by filter names from the first table (4 stakeholders). 

When I select Pre COnversion or Post conversion for John Smith for example: the % Ownership show 100% for him in both cases. 


However, when I pull %ownership pre conversion in the field with the pre conversion name table, I get the correct % ownership. For example in John Smith case, it is 10% pre conversion. Similar to post conversion, % ownership for John Smith is 23% which is correct. 


I hope this help explain my question. And thank you so much for your time trying to help me on this.

Super User IV
Super User IV

@tranmtrang ,The information you have provided is not making the problem clear to me. Can you please explain with an example.
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Appreciate your Kudos.

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors