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
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
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.