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

The Fabric Community site will be in read-only mode on Monday, Feb 24 from 12:01 AM to 8 AM PST for scheduled upgrades.

Reply
Anonymous
Not applicable

Getting a single employee name

Hello everyone.

 

In the past i have worked in mysql, power bi dax is new for me. I am facing problem in solving following problem.

This is a help desk table in which i want to get the name of the concerned person who have completed most of the tickets. 

 

I have a table with column ID (unique), Status, Concerned Person. 

 ID= saves unique number assigned to it

Status= Completed, In Process, Rejected

Concerned Person= Name of the employee

 

I want to get concerned person name against highest number of distinct count (ID) where status is equal to completed.

 

 

 

 

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi, @Anonymous

If there are two or more Concerned Person with the highest number of distinct count (ID), Does result display blank or all?

If it is blank, you could use formula as ryan_mayu above,

and if it is all, You could use this formula:

Measure = 
VAR _table =
    SUMMARIZE (
        FILTER ( Sheet8, Sheet8[status] = "completed" ),
        Sheet8[Concerned Person],
        "ordernumber", DISTINCTCOUNT ( Sheet8[ID] )
    )
VAR maxorder =
    MAXX ( _table, [ordernumber] )
RETURN
    CALCULATE (
        CONCATENATEX ( VALUES ( Sheet8[Concerned Person] ), [Concerned Person], "," ),
        FILTER ( _table, [ordernumber] = maxorder )
    )

1.JPG

 

Best Regards,
Lin

 

 

 

 

Community Support Team _ Lin
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

6 REPLIES 6
v-lili6-msft
Community Support
Community Support

hi, @Anonymous

If there are two or more Concerned Person with the highest number of distinct count (ID), Does result display blank or all?

If it is blank, you could use formula as ryan_mayu above,

and if it is all, You could use this formula:

Measure = 
VAR _table =
    SUMMARIZE (
        FILTER ( Sheet8, Sheet8[status] = "completed" ),
        Sheet8[Concerned Person],
        "ordernumber", DISTINCTCOUNT ( Sheet8[ID] )
    )
VAR maxorder =
    MAXX ( _table, [ordernumber] )
RETURN
    CALCULATE (
        CONCATENATEX ( VALUES ( Sheet8[Concerned Person] ), [Concerned Person], "," ),
        FILTER ( _table, [ordernumber] = maxorder )
    )

1.JPG

 

Best Regards,
Lin

 

 

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ryan_mayu
Super User
Super User

@Anonymous

 

You can try the coding below to see if this meets your requirements. Thanks.

 

Measure = 
VAR _table=SUMMARIZE(FILTER(Sheet8,Sheet8[status]="complete"),Sheet8[person],"ordernumber",DISTINCTCOUNT(Sheet8[order]))
VAR maxorder=MAXX(_table,[ordernumber])
return CALCULATE(SELECTEDVALUE(Sheet8[person]),FILTER(_table,[ordernumber]=maxorder))

 

Capture.JPGc1.JPG





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

Proud to be a Super User!




Anonymous
Not applicable

ryan_mayu Member

I have tried this solution but it is returning BLANK result in the card visual

@Anonymous 

 

could you please share the screenshot of your sample data? Maybe you can also try Lin's solution. Thanks





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

Proud to be a Super User!




Anonymous
Not applicable

@ryan_mayu 

 

Dear, 

 

I have tried Lin's solution and it is working fine. Thanks for your input too. I am working on your solution to see where i am missing.

Thanks alot! 

@Anonymous 

 

You are welcome. Actually Lin and I used the similar solution for you. The difference is that she thought deeper than me. I didn't consider the situation that two cusomers have the same maximum order numbers.

 

Thanks





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

Proud to be a Super User!




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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.