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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
JiriS
Helper I
Helper I

Agregate most often text value

Hi,

 

I need to create a table visualisation.

My data set looks:

 

NamePersonal numberDepartmentHoursDay
Peter1100Department2518.06.2020
Peter1100Department2319.06.2020
Peter1100Department1818.06.2020
Peter1100Department1417.06.2020
Peter1100Department1

2

16.06.2020

Lucy1212Department3

5

16.06.2020

Lucy1212Department1

8

17.06.2020

Lucy1212Department3518.06.2020
John1515Department2218.06.2020

 

How should my dataset for visualisation look like:

 

NamePersonal numberMost often department by personHoursDate
Peter1100Department1518.06.2020
Peter1100Department1319.06.2020
Peter1100Department1818.06.2020
Peter1100Department1417.06.2020
Peter1100Department1

2

16.06.2020

Lucy1212Department3

5

16.06.2020

Lucy1212Department3

8

17.06.2020

Lucy1212Department3518.06.2020
John1515Department2218.06.2020

 

How can I agregate the department by most often value of each person?

 

Thank you for your ideas,

George

4 REPLIES 4
Anonymous
Not applicable

HI @JiriS,

Please explain more about your requirement and processing logic, it is hard to find out the rule for your sample data.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

I am sorry. I split the table rows by Name. Then I count the number of each department for the specific person. The most often value of department is than given in all rows of this person.

 

Do you understand or should I explaint it better?

 

Thank you

Anonymous
Not applicable

Hi @JiriS,

You can use the below calculate column formula to calculate the rank based on the count of person and department, then you can use this as sort order/filter on your visual.

Rank =
VAR _addcolumn =
    ADDCOLUMNS (
        'Table',
        "Merged", [Name] & "|" & [Most often department by person]
    )
VAR summary =
    SUMMARIZE (
        _addcolumn,
        [Merged],
        "Count", COUNTAX ( FILTER ( _addcolumn, [Merged] = EARLIER ( [Merged] ) ), [Merged] )
    )
VAR _current =
    MAXX (
        FILTER (
            summary,
            PATHITEM ( [Merged], 1 ) = EARLIER ( [Name] )
                && PATHITEM ( [Merged], 2 ) = EARLIER ( [Most often department by person] )
        ),
        [Count]
    )
RETURN
    COUNTROWS ( FILTER ( summary, [Count] >= _current ) )

Regards,

Xiaoxin Sheng

Pragati11
Super User
Super User

Hi @JiriS ,

 

Can you tell the logic for Most often value for each person? It is not clear to me.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors