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
dyee4613
Helper I
Helper I

Summarize: Is this how it works?

Problem: I wanted to find out how many unique employees worked each day.  However, the total for distinctcount will only be unique employees for the entire period and not each day.

 

Solution:

VAR SummarizeTry = Summarize(LaborTable,LaborTable[EmpNo],LaborTable[DateWorked],"Count1",Distinctcount(EmpNo))

Return SUMX(SummarizeTry,[Count1])

 

As I understand it, Summarize is taking my data and creating a new table.  In this table, Power BI is doing the same thing as if I went into the powery query and clicked transform --> group by Emp No and Date Worked.  Finally, it creates a measure called Count1 which is a distinct count of the newly grouped table to count the unique entries for each employee for each day.  

 

The SUMX will go line by line and add up the employee count for each day.   Is my understanding correct?

 

 

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @dyee4613 

That's pretty much how it works, yeah, but do note that all values in the Count1 column will be 1, since you are counting over one employee and one day. I'm not sure that's what you are after. You can see the the table produced by summarize directly by creating a new calculated table with the code:

NewTable =
SUMMARIZE (
    LaborTable,
    LaborTable[EmpNo],
    LaborTable[DateWorked],
    "Count1", DISTINCTCOUNT ( LaborTable[EmpNo] )
)

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

View solution in original post

1 REPLY 1
AlB
Super User
Super User

Hi @dyee4613 

That's pretty much how it works, yeah, but do note that all values in the Count1 column will be 1, since you are counting over one employee and one day. I'm not sure that's what you are after. You can see the the table produced by summarize directly by creating a new calculated table with the code:

NewTable =
SUMMARIZE (
    LaborTable,
    LaborTable[EmpNo],
    LaborTable[DateWorked],
    "Count1", DISTINCTCOUNT ( LaborTable[EmpNo] )
)

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

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.

Top Solution Authors