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
Aditya_Meshram
Solution Supplier
Solution Supplier

Removing duplicates and keeping the row with highest value

Hello everyone, I am stuck in a scenario.
I have made a table visual with Employee Name(Which is a column from a table) and Utilization Rate(which is a calculated measure). As given below :

Employee Name Utilization Rate
a 100.00%
b 100.00%
c 100.00%
c 0.00%
d 35.71%
e 0.00%
e 0.00%
e 0.00%
f 72.62%
f 70.24%
g 100.00%

 

From this table visual I want to remove the duplicated employee names. I want to keep only those rows with the highest Utilization Rate as shown below :

Employee Name Utilization Rate
a 100.00%
b 100.00%
c 100.00%
d 35.71%
e 0.00%
f 72.62%
g 100.00%

 

Here I want to remove the rows in red colour. As shown in the immage below :

Aditya_Meshram_0-1646207399763.png

Can anyone help me solve this problem?

1 ACCEPTED SOLUTION

HI @Aditya_Meshram,

You can try to use the following measure to get the max Utilization Rate based on the current employee group:

Measure =
VAR cEName =
    VALUES ( 'Table'[Employee Name] )
RETURN
    MAXX (
        FILTER (
            SUMMARIZE (
                'Table',
                'Table'[Employee Name],
                "mURate", MAX ( 'Table'[Utilization Rate] )
            ),
            [Employee Name] IN cEName
        ),
        [mURate]
    )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

7 REPLIES 7
CNENFRNL
Community Champion
Community Champion

You even don't need an explicit measure to achieve this,

CNENFRNL_0-1646231143502.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Hi @CNENFRNL thanks for your input
But since Uilization Rate is a measure I'm not getting these options.

Aditya_Meshram_0-1646290230846.png
Regards,
Aditya

BeaBF
Impactful Individual
Impactful Individual

@Aditya_Meshram You can create a calculated table as:

 

Tabella 2 = SUMMARIZE(SELECTCOLUMNS('Tabella (4)',
"Employee Name", 'Tabella (4)'[Employee Name]),
[Employee Name],
"Utilization Rate", MAX('Tabella (4)'[Utilization Rate]))
 
Where Tabella(4) is your native Table.
 
The result is the right table:
BeaBF_0-1646226884874.png

 

 
BF

HI @Aditya_Meshram,

You can try to use the following measure to get the max Utilization Rate based on the current employee group:

Measure =
VAR cEName =
    VALUES ( 'Table'[Employee Name] )
RETURN
    MAXX (
        FILTER (
            SUMMARIZE (
                'Table',
                'Table'[Employee Name],
                "mURate", MAX ( 'Table'[Utilization Rate] )
            ),
            [Employee Name] IN cEName
        ),
        [mURate]
    )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi @BeaBF ,
since Utilization Rate is a measure, 
I'm not getting the option to aggregate it.

Aditya_Meshram_1-1646290836541.png

Anyways, thanks for your input.

Aditya

@Aditya_Meshram  can you paste the code of that measure?

 

BF

Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Hi @Aditya_Meshram , we would need more details about the Data Model and DAX Measures to provide a clear solution.  It is likely that Many to One or equivalent is causing the issue.  But I am wondering if you have the following situation occuring.   How to show a name more than once in Power BI - YouTube

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.