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

SUM of column conditional to many values of another column

Hi,

 

I am trying to accomplish something, but don't know how to do it.

 

I have a Dimension (Table) that represents time entries for employees like so :

 

IdEmployeeIdEntryDTTimeInMinutesPriceAgreementId
112017-03-201001
212017-03-3150null
322017-03-211001
422017-03-231252
532017-03-1590null
632017-03-25601

 

Sometimes they work on "PriceAgreements", and sometimes they don't).

 

In my Dashboard, i have a Table that groups that table by EmployeeId and Sums the TimeInMinutes. I also have a Slicer for EntryDT :

 

EmployeeIdTimeInMinutes
1150
2225
3150

 

I need to create 2 new columns that represent :

  1. The total TimeInMinutes an Employee has worked on all PriceAgreements
    So for EmployeeId #1, the Total would be 100.
  2. The total TimeInMinutes ALL Employees have worked, but only for the PriceAgreements the current Employee (current row) has worked on.

So the Table would look like this (without the PriceAgreementIds in parenthesis) :

 

EmployeeIdTimeInMinutesTimeInMinutes on PriceAgreementsTimeInMinutes on PriceAgreements ALL other EmployeeIds
1150100 (PriceAgreementId=1)260 (PriceAgreementId=1)
2225225 (PriceAgreementId=1 and 2)385 (PriceAgreementId=1 and 2)
3150150 (PriceAgreementId=1)260 (PriceAgreementId=1)

 

Column "TimeInMinutes on PriceAgreements" is quite easy, but the other one, i cannot find a solution...

 

I have this DAX expression I started, but it is not complete:

CALCULATE(SUM(TEntry[EmployeeTimeInMinutes]), NOT ISBLANK(TEntry[PriceAgreementId]), ALL(TEmployee))

 

TEmployee is a Dimension linked to the main Entry Table.

 

Any help would be appreciated.

Thank you.

0 REPLIES 0

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.