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
Vitalth
Frequent Visitor

Calculate sum of measure without calculating sum of child

Hi,

 

I have the following table :

 

Employee

EmpIdFullNameResponsible
1Patrick Bateman 
2Dexter Morgan1
3Norman Bates2
4Joe Goldberg2

 

which must read liket this :
- Dexter Morgan reports to Patrick Bateman

- Norman Bates and Joe Goldberg report to Dexter Morgan



I have anoter table Goals like this


Goals

GoalIdGoalsEmpId
412004
312003
220002
117501

 

That means :
- Norman Bates must avec 1200 to reach his goal

- But Dexter Morgan doesn't need 2400 to reach his goal but only 2000.

 

I have a Table as visual with only Goal as Column and I have a filter on Person as Page Filter. Of course, users can filter on one or several persons even no one person.
I want have the following behaviour :
- If no filtrer by user I must display goal for Patrick Bateman (1750) which is the sum of root in path in employee

- If I filter on one user I have to display the goal of the person and not the sum for all poeple who report to him. For instance if I filter on Dexter Morgan, I must display 2000 and not 2400 neither 4400.

- If I filter on several poeple, I mus display the higher person in the hierarchie. For instance if I filter on Patrick Bateman and Dexter Morgan, I should display 1750 and not 3750. But if I filter on Joe Goldberg and Norman Bates, I should display 2400 because Norman Bates doesn't report directly or indirectly to Joe Goldberg and same for Joe Goldberg.

Is that possible to create some calculated measure to have this kind of behaviour ?
Should I created some other column ?

 

Thans for your support.

5 REPLIES 5
Vitalth
Frequent Visitor

OK but how can we had some attached file in this topic ?

eliasayy
Impactful Individual
Impactful Individual

You cant directly attach here you need to upload to one drive or dropbox or any cloud service and copy the link to public here

Vitalth
Frequent Visitor

Yes it doesn't work

eliasayy
Impactful Individual
Impactful Individual

Ok can you please provide me with some sample data 

eliasayy
Impactful Individual
Impactful Individual

Did you try using allexcept?

Calculate(sum(table[goal]),allexcept(table,table[id])

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.