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
Anonymous
Not applicable

All Except Year

Hi, 

I am trying to display the total distinct employees working per day per year, but my All Except formula displays the Total days instead of separating out the days each year...

The formula below is the sum of the distinct count of employees per day:

** Emp Test = sumx(values('CMPL Table'[Date Day]),calculate(distinctcount('CMPL Table'[Employee Name])))
The formula below is what I googled to get the total to be displayed for each year:
**Employees/Day Total = calculate([** Emp Test],allexcept('CMPL Table','CMPL Table'[Employee Name])
 
I am not sure how to separate out the year because if i change the Employee Name to Year in the second formula, it gives the total instead of being able to filter out by Employee Name
 
 
1 ACCEPTED SOLUTION
sevenhills
Super User
Super User

If this is true, that you are looking for count of distinct combinations such as 

     count( DISTINCT Date_Day, Employee_Name) from CMPL table

 

In my view, I will achive using Summarize and CountRows

Emp And Date unique values = COUNTROWS (

           Summarize ( 'CMPL Table', 'CMPL Table'[Date Day], 'CMPL Table'[Employee Name])

)

View solution in original post

5 REPLIES 5
sevenhills
Super User
Super User

If this is true, that you are looking for count of distinct combinations such as 

     count( DISTINCT Date_Day, Employee_Name) from CMPL table

 

In my view, I will achive using Summarize and CountRows

Emp And Date unique values = COUNTROWS (

           Summarize ( 'CMPL Table', 'CMPL Table'[Date Day], 'CMPL Table'[Employee Name])

)

Anonymous
Not applicable

So first I created a formula using the advice you sent me...:

***Employees/Day Total = countrows(SUMMARIZE('CMPL Table','CMPL Table'[Employee Name],'CMPL Table'[Date Day]))
 
From there I created a final formula that displayed the totals correctly:
**Employees/Day Total = calculate([***Employees/Day Total],allexcept('CMPL Table','CMPL Table'[Employee Name],'CMPL Table'[Year]))
 
Thank you again!
Sarah
Anonymous
Not applicable

This worked! i just had to create another formula thank you!

Glad it worked. Please share the formula to the group...

 

Anonymous
Not applicable

Capture.PNG

 

@sevenhills Thank you!
This result does not give me the subtotal for each year for each row though... these are the formulas i used below:

 

** Emp Test = sumx(values('CMPL Table'[Date Day]),calculate(distinctcount('CMPL Table'[Employee Name])))
**Employees/Day Total = calculate([** Emp Test],allexcept('CMPL Table','CMPL Table'[Employee Name]))
 
***Employees/Day Total = countrows(SUMMARIZE('CMPL Table','CMPL Table'[Employee Name],'CMPL Table'[Date Day]))
 
*Stevenson Day2 is the result that i am looking for
 
Thank you!
Sarah

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.