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

Show top 50% number in table

Hello, 

 

i want to convert this excel Sheet  in POWER BI Table. The help needed is to show YES under Top 50% column if the Employee is within the top 50% of the population and the count of employee will be dependent on the filters selected in power BI.

 

in this example, I have a total of 16 employees. the top 50% is 8 and i want to show the "Yes" beside those within the top 50% of the population and "No" otherwise.

 

excel.pngPOWER BI TABLE.png

 

 

Thanks for the help

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @heartless99,

 

Assuming that the Rank you have is a measure based on the % create the following measures:

 

Ranking =
RANKX (
    ALL ( Table1[ID]; Table1[Name]; Table1[Rank] );
    CALCULATE ( SUM ( Table1[Rank] ) )
) Top 50% =
IF (
    [Ranking]
        <= CALCULATE (
            DISTINCTCOUNT ( Table1[Name] );
            ALL ( Table1[Name]; Table1[ID]; Table1[Rank] )
        )
            / 2;
    1;
    0
)

The second one is to make the conditional formatting of the column Rank or any other you would like then just do a condittional formating.

colou.pngconditional.png

 

Regards,

MFelix

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
heartless99
New Member

Thanks a lot. This solved my problem. 😃 

MFelix
Super User
Super User

Hi @heartless99,

 

Assuming that the Rank you have is a measure based on the % create the following measures:

 

Ranking =
RANKX (
    ALL ( Table1[ID]; Table1[Name]; Table1[Rank] );
    CALCULATE ( SUM ( Table1[Rank] ) )
) Top 50% =
IF (
    [Ranking]
        <= CALCULATE (
            DISTINCTCOUNT ( Table1[Name] );
            ALL ( Table1[Name]; Table1[ID]; Table1[Rank] )
        )
            / 2;
    1;
    0
)

The second one is to make the conditional formatting of the column Rank or any other you would like then just do a condittional formating.

colou.pngconditional.png

 

Regards,

MFelix

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.