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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
r17
New Member

Lineage and filter expansion

Dear Experts,

 

My source data is as below. I want to SUM(Table[Value]) per BU, but for all non BU Common I need to include Values of the Employees that appear in BU Common.

 

BUEmployeeValue
BU Common11
BU Common32
BU 113
BU 114
BU 125
BU 216
BU 237

 

A simple pivot with BU on rows should return

BU 1: 13 (3+4+5+1)

BU 2: 16 (6+7+1+2)

 

The measure I struggle with:

CALCULATE( SUM(Table[Value], ALL( Table[BU] ), UNION( VALUES( Table[BU] ), ROW("BU", "BU Common") ), VALUES( Table[Employee] )

 

I already see the problem with lost lineage due to UNION and ROW, but can't come up with an alternative solution.

What if instead of simple SUM all rows (3, 4, 5, 1 for BU 1) should be returned?

 

Would appreciate any help on this.

Thank you!

1 ACCEPTED SOLUTION

Thank you!

 

I've also come up with the following solution

 

CALCULATE(

Table[Value];

FILTER(ALL(Table[BU]);Table[BU] IN VALUES(Table[BU]) || Table[BU] = "BU Common");
VALUES(Table[Employee])
)

View solution in original post

2 REPLIES 2
v-yuezhe-msft
Employee
Employee

@r17,

Firstly, pivot columns as follows.

1.JPG

Secondly, create the following columns in your table.

BU1TOTAL = IF(NOT(ISBLANK('Table'[BU 1])),'Table'[BU 1]+'Table'[BU Common],0)
BU2TOTAL = IF(NOT(ISBLANK('Table'[BU 2])),'Table'[BU 2]+'Table'[BU Common],0)
2.JPG

Regards,

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you!

 

I've also come up with the following solution

 

CALCULATE(

Table[Value];

FILTER(ALL(Table[BU]);Table[BU] IN VALUES(Table[BU]) || Table[BU] = "BU Common");
VALUES(Table[Employee])
)

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.